| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:8:3: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // const A.named1() sync* {} |
| // ^^^^^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:13:1: Error: An external or native method can't have a body. |
| // external foo(String x) { |
| // ^^^^^^^^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:10:26: Error: New expression is not a constant expression. |
| // const A.named2() : x = new Object(); |
| // ^^^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration. |
| // const A.named2() : x = new Object(); |
| // ^ |
| // pkg/front_end/testcases/general/many_errors2.dart:6:9: Context: 'x' was initialized here. |
| // final x = null; |
| // ^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.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(); |
| // ^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:8:26: Error: Constructor bodies can't use 'async', 'async*', or 'sync*'. |
| // const A.named1() sync* {} |
| // ^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:13:24: Error: An external or native method can't have a body. |
| // external foo(String x) { |
| // ^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:28:9: Error: The class 'AbstractClass' is abstract and can't be instantiated. |
| // const AbstractClass.id(); |
| // ^^^^^^^^^^^^^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:28:9: Error: Cannot invoke a non-'const' constructor where a const expression is expected. |
| // Try using a constructor or factory that is 'const'. |
| // const AbstractClass.id(); |
| // ^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:29:12: Warning: Operand of null-aware operation '??=' has type 'B' which excludes null. |
| // - 'B' is from 'pkg/front_end/testcases/general/many_errors2.dart'. |
| // (new C().b ??= new B()).b; |
| // ^ |
| // |
| // pkg/front_end/testcases/general/many_errors2.dart:29:27: Error: The getter 'b' isn't defined for the class 'B'. |
| // - 'B' is from 'pkg/front_end/testcases/general/many_errors2.dart'. |
| // Try correcting the name to the name of an existing getter, or defining a getter or field named 'b'. |
| // (new C().b ??= new B()).b; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class A extends core::Object /*hasConstConstructor*/ { |
| final field dynamic x = null; |
| constructor named1() → self::A |
| : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/general/many_errors2.dart:8:26: Error: Constructor bodies can't use 'async', 'async*', or 'sync*'. |
| const A.named1() sync* {} |
| ^" {} |
| const constructor named2() → self::A |
| : final dynamic #t2 = throw invalid-expression "pkg/front_end/testcases/general/many_errors2.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 { |
| synthetic constructor •() → self::B |
| : super core::Object::•() |
| ; |
| } |
| class C extends core::Object { |
| late field self::B b; |
| synthetic constructor •() → self::C |
| : super core::Object::•() |
| ; |
| } |
| abstract class AbstractClass extends core::Object /*hasConstConstructor*/ { |
| const constructor id() → self::AbstractClass |
| : super core::Object::•() |
| ; |
| } |
| external static method foo(core::String x) → dynamic { |
| invalid-expression "pkg/front_end/testcases/general/many_errors2.dart:13:24: Error: An external or native method can't have a body. |
| external foo(String x) { |
| ^"; |
| { |
| return x.{core::String::length}{core::int}; |
| } |
| } |
| static method m() → dynamic { |
| throw invalid-expression "pkg/front_end/testcases/general/many_errors2.dart:28:9: Error: Cannot invoke a non-'const' constructor where a const expression is expected. |
| Try using a constructor or factory that is 'const'. |
| const AbstractClass.id(); |
| ^"; |
| invalid-expression "pkg/front_end/testcases/general/many_errors2.dart:29:27: Error: The getter 'b' isn't defined for the class 'B'. |
| - 'B' is from 'pkg/front_end/testcases/general/many_errors2.dart'. |
| Try correcting the name to the name of an existing getter, or defining a getter or field named 'b'. |
| (new C().b ??= new B()).b; |
| ^" in (let final self::C #t3 = new self::C::•() in let final self::B #t4 = #t3.{self::C::b}{self::B} in #t4 == null ?{self::B} #t3.{self::C::b} = new self::B::•() : #t4){<unresolved>}.b; |
| } |
| static method main() → dynamic {} |