diff --git a/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart b/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart index 31a7f860144..0ce6588ad3c 100644 --- a/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart +++ b/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart @@ -96,8 +96,6 @@ import '../problems.dart' show unexpected; import '../source/source_library_builder.dart' show SourceLibraryBuilder; -import '../source/source_loader.dart' show SourceLoader; - import '../type_inference/type_inference_engine.dart' show IncludesTypeParametersNonCovariantly, Variance; @@ -657,11 +655,6 @@ class ConstructorBuilder extends FunctionBuilder { library, classBuilder, this, classBuilder.scope, fileUri); bodyBuilder.constantContext = ConstantContext.inferred; bodyBuilder.parseInitializers(beginInitializers); - if (library.loader is SourceLoader) { - SourceLoader loader = library.loader; - loader.transformPostInference(target, bodyBuilder.transformSetLiterals, - bodyBuilder.transformCollections); - } bodyBuilder.resolveRedirectingFactoryTargets(); } beginInitializers = null; diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart index 58b2e7d2a74..a0ad9c16d03 100644 --- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart +++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart @@ -1227,6 +1227,9 @@ class BodyBuilder extends ScopeListener } else { handleNoInitializers(); } + // We are passing [AsyncMarker.Sync] because the error will be reported + // already. + finishConstructor(member, AsyncMarker.Sync); } Expression parseFieldInitializer(Token token) { diff --git a/pkg/front_end/testcases/general/DeltaBlue.dart.outline.expect b/pkg/front_end/testcases/general/DeltaBlue.dart.outline.expect index 76a3a861bf4..daecf9e2038 100644 --- a/pkg/front_end/testcases/general/DeltaBlue.dart.outline.expect +++ b/pkg/front_end/testcases/general/DeltaBlue.dart.outline.expect @@ -12,7 +12,7 @@ class Strength extends core::Object { final field core::int* value; final field core::String* name; const constructor •(core::int* value, core::String* name) → self::Strength* - : self::Strength::value = value, self::Strength::name = name + : self::Strength::value = value, self::Strength::name = name, super core::Object::•() ; method nextWeaker() → self::Strength* ; @@ -28,7 +28,7 @@ class Strength extends core::Object { abstract class Constraint extends core::Object { final field self::Strength* strength; const constructor •(self::Strength* strength) → self::Constraint* - : self::Constraint::strength = strength + : self::Constraint::strength = strength, super core::Object::•() ; abstract method isSatisfied() → core::bool*; abstract method markUnsatisfied() → void; diff --git a/pkg/front_end/testcases/general/annotation_on_enum_values.dart.outline.expect b/pkg/front_end/testcases/general/annotation_on_enum_values.dart.outline.expect index 94c3670551b..466c02c8645 100644 --- a/pkg/front_end/testcases/general/annotation_on_enum_values.dart.outline.expect +++ b/pkg/front_end/testcases/general/annotation_on_enum_values.dart.outline.expect @@ -5,7 +5,7 @@ import "dart:core" as core; class Fisk extends core::Object { final field self::Fisk::T* x; const constructor fisk(self::Fisk::T* x) → self::Fisk* - : self::Fisk::x = x + : self::Fisk::x = x, super core::Object::•() ; } class Foo extends core::Object { diff --git a/pkg/front_end/testcases/general/annotation_top.dart.outline.expect b/pkg/front_end/testcases/general/annotation_top.dart.outline.expect index 6d2ad32f1f4..5fc0262855e 100644 --- a/pkg/front_end/testcases/general/annotation_top.dart.outline.expect +++ b/pkg/front_end/testcases/general/annotation_top.dart.outline.expect @@ -8,6 +8,7 @@ typedef F1 = () →* void; typedef F2 = () →* void; class A extends core::Object { const constructor •(core::int* value) → self::A* + : super core::Object::•() ; } @self::a diff --git a/pkg/front_end/testcases/general/annotation_variable_declaration.dart.outline.expect b/pkg/front_end/testcases/general/annotation_variable_declaration.dart.outline.expect index 75c5ca88cf6..368f1dd9af0 100644 --- a/pkg/front_end/testcases/general/annotation_variable_declaration.dart.outline.expect +++ b/pkg/front_end/testcases/general/annotation_variable_declaration.dart.outline.expect @@ -5,8 +5,10 @@ import "dart:core" as core; typedef hest_t = ({named: dynamic}) →* dynamic; class Bar extends core::Object { const constructor •() → self::Bar* + : super core::Object::•() ; const constructor named(dynamic x) → self::Bar* + : super core::Object::•() ; } class Baz extends core::Object { diff --git a/pkg/front_end/testcases/general/bug33099.dart.outline.expect b/pkg/front_end/testcases/general/bug33099.dart.outline.expect index 361c3a89b43..511a3f479b7 100644 --- a/pkg/front_end/testcases/general/bug33099.dart.outline.expect +++ b/pkg/front_end/testcases/general/bug33099.dart.outline.expect @@ -7,6 +7,7 @@ import "dart:mirrors"; class _FailingTest extends core::Object { const constructor •() → self::_FailingTest* + : super core::Object::•() ; } class MyTest extends core::Object { diff --git a/pkg/front_end/testcases/general/co19_language_metadata_syntax_t04.dart.outline.expect b/pkg/front_end/testcases/general/co19_language_metadata_syntax_t04.dart.outline.expect index 6aa81e94b82..fbca3b488b1 100644 --- a/pkg/front_end/testcases/general/co19_language_metadata_syntax_t04.dart.outline.expect +++ b/pkg/front_end/testcases/general/co19_language_metadata_syntax_t04.dart.outline.expect @@ -18,6 +18,7 @@ import "dart:core" as core; class A extends core::Object { const constructor •() → self::A* + : super core::Object::•() ; } class B extends core::Object { diff --git a/pkg/front_end/testcases/general/constructor_const_inference.dart.outline.expect b/pkg/front_end/testcases/general/constructor_const_inference.dart.outline.expect index ad737d6955c..6cda74d5595 100644 --- a/pkg/front_end/testcases/general/constructor_const_inference.dart.outline.expect +++ b/pkg/front_end/testcases/general/constructor_const_inference.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class _Y extends core::Object { const constructor •() → self::_Y* + : super core::Object::•() ; } class A extends core::Object { diff --git a/pkg/front_end/testcases/general/implicit_const_with_static_fields.dart.outline.expect b/pkg/front_end/testcases/general/implicit_const_with_static_fields.dart.outline.expect index e224b2a859a..07147d2946d 100644 --- a/pkg/front_end/testcases/general/implicit_const_with_static_fields.dart.outline.expect +++ b/pkg/front_end/testcases/general/implicit_const_with_static_fields.dart.outline.expect @@ -5,6 +5,7 @@ import "dart:core" as core; class C extends core::Object { static const field dynamic constField = 87; const constructor •(dynamic x) → self::C* + : super core::Object::•() ; } static const field dynamic constTopLevelField = 42; diff --git a/pkg/front_end/testcases/general/magic_const.dart.outline.expect b/pkg/front_end/testcases/general/magic_const.dart.outline.expect index b34df979f86..02428e5063f 100644 --- a/pkg/front_end/testcases/general/magic_const.dart.outline.expect +++ b/pkg/front_end/testcases/general/magic_const.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class Constant extends core::Object { const constructor •() → self::Constant* + : super core::Object::•() ; } class NotConstant extends core::Object { diff --git a/pkg/front_end/testcases/general/many_errors.dart.outline.expect b/pkg/front_end/testcases/general/many_errors.dart.outline.expect index 61086699155..27f485d019a 100644 --- a/pkg/front_end/testcases/general/many_errors.dart.outline.expect +++ b/pkg/front_end/testcases/general/many_errors.dart.outline.expect @@ -38,7 +38,7 @@ class A extends core::Object { : final dynamic #t1 = throw invalid-expression "pkg/front_end/testcases/general/many_errors.dart:10:24: Error: Cannot invoke a non-'const' constructor where a const expression is expected. Try using a constructor or factory that is 'const'. const A.named2() : x = new Object(); - ^" + ^", super core::Object::•() ; } class B extends core::Object { @@ -52,6 +52,7 @@ class C extends core::Object { } abstract class AbstractClass extends core::Object { const constructor id() → self::AbstractClass* + : super core::Object::•() ; } external static method foo(core::String* x) → dynamic; diff --git a/pkg/front_end/testcases/general/nested_implicit_const_with_env_var.dart.outline.expect b/pkg/front_end/testcases/general/nested_implicit_const_with_env_var.dart.outline.expect index 00ef691ea46..536cae19a94 100644 --- a/pkg/front_end/testcases/general/nested_implicit_const_with_env_var.dart.outline.expect +++ b/pkg/front_end/testcases/general/nested_implicit_const_with_env_var.dart.outline.expect @@ -5,13 +5,13 @@ import "dart:core" as core; class A extends core::Object { final field core::int* bar; const constructor •(core::int* bar) → self::A* - : self::A::bar = bar + : self::A::bar = bar, super core::Object::•() ; } class B extends core::Object { final field self::A* baz; const constructor •(self::A* baz) → self::B* - : self::B::baz = baz + : self::B::baz = baz, super core::Object::•() ; } class C extends core::Object { diff --git a/pkg/front_end/testcases/general/redirecting_factory_const_inference.dart.outline.expect b/pkg/front_end/testcases/general/redirecting_factory_const_inference.dart.outline.expect index 4494cbc5ce7..2d1371090af 100644 --- a/pkg/front_end/testcases/general/redirecting_factory_const_inference.dart.outline.expect +++ b/pkg/front_end/testcases/general/redirecting_factory_const_inference.dart.outline.expect @@ -9,6 +9,7 @@ class _X extends core::Object { } class _Y extends core::Object implements self::_X { const constructor •() → self::_Y* + : super core::Object::•() ; } class A extends core::Object { diff --git a/pkg/front_end/testcases/general/redirection_type_arguments.dart.outline.expect b/pkg/front_end/testcases/general/redirection_type_arguments.dart.outline.expect index c2a9b20463c..41181941707 100644 --- a/pkg/front_end/testcases/general/redirection_type_arguments.dart.outline.expect +++ b/pkg/front_end/testcases/general/redirection_type_arguments.dart.outline.expect @@ -7,6 +7,7 @@ import "package:expect/expect.dart"; class A extends core::Object { static field dynamic _redirecting# = [self::A::•]; const constructor empty() → self::A* + : super core::Object::•() ; static factory •() → self::A* let dynamic #redirecting_factory = self::B::• in let core::String* #typeArg0 = null in invalid-expression; diff --git a/pkg/front_end/testcases/general/type_variable_uses.dart.outline.expect b/pkg/front_end/testcases/general/type_variable_uses.dart.outline.expect index f500da2c8a6..9bdf11749dc 100644 --- a/pkg/front_end/testcases/general/type_variable_uses.dart.outline.expect +++ b/pkg/front_end/testcases/general/type_variable_uses.dart.outline.expect @@ -11,6 +11,7 @@ import "dart:core" as core; class C extends core::Object { const constructor •() → self::C* + : super core::Object::•() ; static method staticMethod() → self::C* ; diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations.dart.outline.expect index b4244edf2ef..14bb44272dd 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations.dart.outline.expect @@ -4,8 +4,10 @@ import "dart:core" as core; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; const constructor named(core::List* l) → self::Foo* + : super core::Object::•() ; } @self::Foo::•(const []) diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_class_members.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_class_members.dart.outline.expect index 5c69ebd03ce..779bc6967e9 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_class_members.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_class_members.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; } abstract class Bar extends core::Object { diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_for_loop_variable.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_for_loop_variable.dart.outline.expect index 8bf096bb338..e9ee04c9353 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_for_loop_variable.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_for_loop_variable.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; } static method test() → void diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_locals.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_locals.dart.outline.expect index 8bf096bb338..e9ee04c9353 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_locals.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_locals.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; } static method test() → void diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_locals_referring_to_locals.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_locals_referring_to_locals.dart.outline.expect index e054e5327ba..401d558b88c 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_locals_referring_to_locals.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_locals_referring_to_locals.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class Foo extends core::Object { const constructor •(dynamic l) → self::Foo* + : super core::Object::•() ; } static method test() → void diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_parameter.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_parameter.dart.outline.expect index 4df6645a20d..4c70c660a73 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_parameter.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_parameter.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; } class C extends core::Object { diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_parameter_local.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_parameter_local.dart.outline.expect index 8bf096bb338..e9ee04c9353 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_parameter_local.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_parameter_local.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; } static method test() → void diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.outline.expect index 209ecbd5602..38a6f9a9ead 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.outline.expect @@ -5,6 +5,7 @@ import "dart:core" as core; typedef F = () →* void; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; } class C extends core::Object { diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.outline.expect index 8bf096bb338..e9ee04c9353 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; } static method test() → void diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_typedef.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_typedef.dart.outline.expect index a0228d7b8d3..1f341e92849 100644 --- a/pkg/front_end/testcases/inference/downwards_inference_annotations_typedef.dart.outline.expect +++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_typedef.dart.outline.expect @@ -5,6 +5,7 @@ import "dart:core" as core; typedef F = () →* void; class Foo extends core::Object { const constructor •(core::List* l) → self::Foo* + : super core::Object::•() ; } static method main() → dynamic diff --git a/pkg/front_end/testcases/inference/non_const_invocation.dart.outline.expect b/pkg/front_end/testcases/inference/non_const_invocation.dart.outline.expect index 63177d4a6a4..e56ff7a39cd 100644 --- a/pkg/front_end/testcases/inference/non_const_invocation.dart.outline.expect +++ b/pkg/front_end/testcases/inference/non_const_invocation.dart.outline.expect @@ -27,6 +27,7 @@ class Foo extends core::Object { } class Bar extends core::Object { const constructor •() → self::Bar* + : super core::Object::•() ; } static method main() → dynamic diff --git a/pkg/front_end/testcases/inference_new/const_invocation.dart.outline.expect b/pkg/front_end/testcases/inference_new/const_invocation.dart.outline.expect index 63177d4a6a4..e56ff7a39cd 100644 --- a/pkg/front_end/testcases/inference_new/const_invocation.dart.outline.expect +++ b/pkg/front_end/testcases/inference_new/const_invocation.dart.outline.expect @@ -27,6 +27,7 @@ class Foo extends core::Object { } class Bar extends core::Object { const constructor •() → self::Bar* + : super core::Object::•() ; } static method main() → dynamic diff --git a/pkg/front_end/testcases/inference_new/switch.dart.outline.expect b/pkg/front_end/testcases/inference_new/switch.dart.outline.expect index eeb9e1717f0..24795714745 100644 --- a/pkg/front_end/testcases/inference_new/switch.dart.outline.expect +++ b/pkg/front_end/testcases/inference_new/switch.dart.outline.expect @@ -4,6 +4,7 @@ import "dart:core" as core; class C extends core::Object { const constructor •() → self::C* + : super core::Object::•() ; } static method f() → self::f::T* diff --git a/pkg/front_end/testcases/new_const_insertion/simple.dart.outline.expect b/pkg/front_end/testcases/new_const_insertion/simple.dart.outline.expect index c53974f3db0..5092f400b33 100644 --- a/pkg/front_end/testcases/new_const_insertion/simple.dart.outline.expect +++ b/pkg/front_end/testcases/new_const_insertion/simple.dart.outline.expect @@ -5,7 +5,7 @@ import "dart:core" as core; class A extends core::Object { final field core::int* x; const constructor •(core::int* x) → self::A* - : self::A::x = x + : self::A::x = x, super core::Object::•() ; } static method main() → dynamic diff --git a/pkg/front_end/testcases/rasta/bad_constructor_redirection.dart.outline.expect b/pkg/front_end/testcases/rasta/bad_constructor_redirection.dart.outline.expect index b573f2ce90f..e6caacb3bd5 100644 --- a/pkg/front_end/testcases/rasta/bad_constructor_redirection.dart.outline.expect +++ b/pkg/front_end/testcases/rasta/bad_constructor_redirection.dart.outline.expect @@ -18,6 +18,7 @@ Try removing the extra positional arguments. ^" ; const constructor x() → self::C* + : super core::Object::•() ; } static method main() → dynamic diff --git a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.legacy.expect b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.legacy.expect index 4f21facc6ab..0ddc60f383e 100644 --- a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.legacy.expect +++ b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.legacy.expect @@ -2,14 +2,14 @@ library; // // Problems in library: // -// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:6:10: Error: 'x' isn't an instance field of this class. -// A(this.x); -// ^ -// // pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:10:9: Error: The superclass, 'A', has no unnamed constructor that takes no arguments. // const B(); // ^ // +// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:6:10: Error: 'x' isn't an instance field of this class. +// A(this.x); +// ^ +// import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.legacy.transformed.expect b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.legacy.transformed.expect index 4f21facc6ab..0ddc60f383e 100644 --- a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.legacy.transformed.expect +++ b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.legacy.transformed.expect @@ -2,14 +2,14 @@ library; // // Problems in library: // -// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:6:10: Error: 'x' isn't an instance field of this class. -// A(this.x); -// ^ -// // pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:10:9: Error: The superclass, 'A', has no unnamed constructor that takes no arguments. // const B(); // ^ // +// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:6:10: Error: 'x' isn't an instance field of this class. +// A(this.x); +// ^ +// import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.outline.expect b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.outline.expect index f868e38dfa4..57359a4c20d 100644 --- a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.outline.expect +++ b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.outline.expect @@ -1,4 +1,11 @@ library; +// +// Problems in library: +// +// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:10:9: Error: The superclass, 'A', has no unnamed constructor that takes no arguments. +// const B(); +// ^ +// import self as self; import "dart:core" as core; @@ -8,6 +15,9 @@ class A extends core::Object { } class B extends self::A { const constructor •() → self::B* + : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:10:9: Error: The superclass, 'A', has no unnamed constructor that takes no arguments. + const B(); + ^" ; } static method main() → dynamic diff --git a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.strong.expect b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.strong.expect index 4f21facc6ab..0ddc60f383e 100644 --- a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.strong.expect +++ b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.strong.expect @@ -2,14 +2,14 @@ library; // // Problems in library: // -// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:6:10: Error: 'x' isn't an instance field of this class. -// A(this.x); -// ^ -// // pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:10:9: Error: The superclass, 'A', has no unnamed constructor that takes no arguments. // const B(); // ^ // +// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:6:10: Error: 'x' isn't an instance field of this class. +// A(this.x); +// ^ +// import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.strong.transformed.expect b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.strong.transformed.expect index 4f21facc6ab..0ddc60f383e 100644 --- a/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart.strong.transformed.expect @@ -2,14 +2,14 @@ library; // // Problems in library: // -// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:6:10: Error: 'x' isn't an instance field of this class. -// A(this.x); -// ^ -// // pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:10:9: Error: The superclass, 'A', has no unnamed constructor that takes no arguments. // const B(); // ^ // +// pkg/front_end/testcases/rasta/bad_implicit_super_constructor.dart:6:10: Error: 'x' isn't an instance field of this class. +// A(this.x); +// ^ +// import self as self; import "dart:core" as core; diff --git a/pkg/front_end/testcases/rasta/issue_000044.dart.outline.expect b/pkg/front_end/testcases/rasta/issue_000044.dart.outline.expect index 50ce0143e6f..35d05442dcd 100644 --- a/pkg/front_end/testcases/rasta/issue_000044.dart.outline.expect +++ b/pkg/front_end/testcases/rasta/issue_000044.dart.outline.expect @@ -31,6 +31,7 @@ import "dart:core" as core; class C extends core::Object { static field dynamic _redirecting# = [self::C::good]; const constructor constant() → self::C* + : super core::Object::•() ; constructor missingFactoryKeyword() → self::C* ; diff --git a/pkg/front_end/testcases/rasta/issue_000070.dart.outline.expect b/pkg/front_end/testcases/rasta/issue_000070.dart.outline.expect index cbc488a5e54..45c7070524e 100644 --- a/pkg/front_end/testcases/rasta/issue_000070.dart.outline.expect +++ b/pkg/front_end/testcases/rasta/issue_000070.dart.outline.expect @@ -11,7 +11,7 @@ class A* ; const constructor c(self::A::U* u, self::A::S* s) → self::A* - : self::A::field = const [null] + : self::A::field = const [null], super core::Object::•() ; static factory f(self::A::f::S* s) → self::A* ; diff --git a/pkg/front_end/testcases/regress/issue_34403.dart.outline.expect b/pkg/front_end/testcases/regress/issue_34403.dart.outline.expect index 9d1fae09dd7..0983f9985c1 100644 --- a/pkg/front_end/testcases/regress/issue_34403.dart.outline.expect +++ b/pkg/front_end/testcases/regress/issue_34403.dart.outline.expect @@ -10,6 +10,7 @@ class C extends core::Object { } class D extends core::Object { const constructor foo() → self::D* + : super core::Object::•() ; } static method main() → dynamic @@ -25,5 +26,6 @@ class E extends core::Object { } class F extends core::Object { const constructor foo() → self2::F* + : super core::Object::•() ; } diff --git a/tests/modular/issue37794/main.dart b/tests/modular/issue37794/main.dart new file mode 100644 index 00000000000..d1c1e1cbfc4 --- /dev/null +++ b/tests/modular/issue37794/main.dart @@ -0,0 +1,16 @@ +// Copyright (c) 2019, 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:expect/expect.dart'; + +import 'module2.dart'; +import 'module1.dart'; + +main() { + const x = B(); + const y = A(); + Expect.equals('foo', x.foo); + Expect.listEquals(['l', 'i', 's', 't'], x.list); + Expect.equals('foo', y.foo); + Expect.listEquals(['l', 'i', 's', 't'], y.list); +} diff --git a/tests/modular/issue37794/module1.dart b/tests/modular/issue37794/module1.dart new file mode 100644 index 00000000000..6a41a305934 --- /dev/null +++ b/tests/modular/issue37794/module1.dart @@ -0,0 +1,16 @@ +// Copyright (c) 2019, 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. + +class A { + final String foo; + final List list; + + const A( + [this.foo = 'foo', + this.list = const [ + 'l', + ...['i', 's'], + 't' + ]]); +} diff --git a/tests/modular/issue37794/module2.dart b/tests/modular/issue37794/module2.dart new file mode 100644 index 00000000000..881d85a9de0 --- /dev/null +++ b/tests/modular/issue37794/module2.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2019, 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 'module1.dart'; + +class B extends A { + const B(); +} diff --git a/tests/modular/issue37794/modules.yaml b/tests/modular/issue37794/modules.yaml new file mode 100644 index 00000000000..c4954a91a9f --- /dev/null +++ b/tests/modular/issue37794/modules.yaml @@ -0,0 +1,9 @@ +# Copyright (c) 2019, 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. + +dependencies: + main: [module1, module2, expect] + module2: [module1] +flags: + - constant-update-2018 \ No newline at end of file