-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cfe] Create fields through SourcePropertyBuilder
Change-Id: I20c9dd7baa705aba77d90b94ba0a46ed64eb02ec Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403600 Commit-Queue: Johnni Winther <[email protected]> Reviewed-by: Chloe Stefantsova <[email protected]>
- Loading branch information
1 parent
ad562fd
commit a6b99af
Showing
40 changed files
with
3,310 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:kernel/ast.dart'; | ||
import 'package:kernel/class_hierarchy.dart'; | ||
|
||
import 'member_builder.dart'; | ||
|
||
abstract class PropertyBuilder implements MemberBuilder { | ||
bool get hasInitializer; | ||
|
||
@override | ||
Uri get fileUri; | ||
|
||
bool get isExtensionTypeDeclaredInstanceField; | ||
|
||
bool get isLate; | ||
|
||
bool get isFinal; | ||
|
||
abstract DartType fieldType; | ||
|
||
DartType inferType(ClassHierarchyBase hierarchy); | ||
|
||
/// Builds the field initializers for each field used to encode this field | ||
/// using the [fileOffset] for the created nodes and [value] as the initial | ||
/// field value. | ||
List<Initializer> buildInitializer(int fileOffset, Expression value, | ||
{required bool isSynthetic}); | ||
|
||
/// Creates the AST node for this field as the default initializer. | ||
void buildImplicitDefaultValue(); | ||
|
||
/// Create the [Initializer] for the implicit initialization of this field | ||
/// in a constructor. | ||
Initializer buildImplicitInitializer(); | ||
|
||
Initializer buildErroneousInitializer(Expression effect, Expression value, | ||
{required int fileOffset}); | ||
} |
Oops, something went wrong.