Skip to content

Commit 6e8e0f8

Browse files
johnniwintherCommit Queue
authored andcommitted
[cfe] Implement synthetic constructors through ConstructorDeclaration
This implements the synthesized constructors for default constructors and forwarding constructors, avoiding the need for SyntheticSourceConstructorBuilder. Change-Id: Iaf7234aab658122a29c644226bf82a63f7895246 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432700 Reviewed-by: Chloe Stefantsova <[email protected]> Commit-Queue: Johnni Winther <[email protected]>
1 parent f8e21c5 commit 6e8e0f8

13 files changed

+429
-353
lines changed

pkg/front_end/lib/src/fragment/constructor.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ConstructorFragment implements Fragment, FunctionFragment {
3131
final DeclarationFragment enclosingDeclaration;
3232
final LibraryFragment enclosingCompilationUnit;
3333

34-
SourceConstructorBuilderImpl? _builder;
34+
SourceConstructorBuilder? _builder;
3535

3636
ConstructorFragmentDeclaration? _declaration;
3737

@@ -68,12 +68,12 @@ class ConstructorFragment implements Fragment, FunctionFragment {
6868
}
6969

7070
@override
71-
SourceConstructorBuilderImpl get builder {
71+
SourceConstructorBuilder get builder {
7272
assert(_builder != null, "Builder has not been computed for $this.");
7373
return _builder!;
7474
}
7575

76-
void set builder(SourceConstructorBuilderImpl value) {
76+
void set builder(SourceConstructorBuilder value) {
7777
assert(_builder == null, "Builder has already been computed for $this.");
7878
_builder = value;
7979
}

pkg/front_end/lib/src/fragment/constructor/body_builder_context.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import '../../type_inference/type_inferrer.dart';
2020
import 'declaration.dart';
2121

2222
class ConstructorBodyBuilderContext extends BodyBuilderContext {
23-
final SourceConstructorBuilderImpl _builder;
23+
final SourceConstructorBuilder _builder;
2424

2525
final ConstructorFragmentDeclaration _declaration;
2626

0 commit comments

Comments
 (0)