| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/extension_types/issue52284.dart:9:11: Error: The getter 'unresolved' isn't defined for the class 'Id'. |
| // Try correcting the name to the name of an existing getter, or defining a getter or field named 'unresolved'. |
| // print(c.unresolved); // Error |
| // ^^^^^^^^^^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| extension type Id(core::int id) { |
| abstract extension-type-member representation-field get id() → core::int; |
| constructor • = self::Id|constructor#; |
| constructor tearoff • = self::Id|constructor#_#new#tearOff; |
| } |
| static extension-type-member method Id|constructor#(core::int id) → self::Id% /* erasure=core::int, declared=! */ { |
| lowered final self::Id% /* erasure=core::int, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method Id|constructor#_#new#tearOff(core::int id) → self::Id% /* erasure=core::int, declared=! */ |
| return self::Id|constructor#(id); |
| static method test() → dynamic { |
| self::Id% /* erasure=core::int, declared=! */ c = self::Id|constructor#(2); |
| core::print(invalid-expression "pkg/front_end/testcases/extension_types/issue52284.dart:9:11: Error: The getter 'unresolved' isn't defined for the class 'Id'. |
| Try correcting the name to the name of an existing getter, or defining a getter or field named 'unresolved'. |
| print(c.unresolved); // Error |
| ^^^^^^^^^^" in c{<unresolved>}.unresolved); |
| } |
| static method main() → dynamic { |
| self::Id% /* erasure=core::int, declared=! */ c = self::Id|constructor#(2); |
| self::expect(#C1, c.{core::Object::runtimeType}{core::Type}); |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "Expected ${expected}, actual ${actual}"; |
| } |
| |
| constants { |
| #C1 = TypeLiteralConstant(core::int) |
| } |