| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inline_class/issue52119.dart:15:26: Error: Couldn't find constructor 'Foo.unresolved'. |
| // Foo.erroneous() : this.unresolved(); |
| // ^^^^^^^^^^ |
| // |
| // pkg/front_end/testcases/inline_class/issue52119.dart:15:3: Error: Final field 'i' is not initialized by this constructor. |
| // Try to initialize the field using an initializing formal or a field initializer. |
| // Foo.erroneous() : this.unresolved(); |
| // ^^^^^^^^^ |
| // pkg/front_end/testcases/inline_class/issue52119.dart:6:13: Context: 'i' is defined here. |
| // final int i; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| inline class Foo /* declaredRepresentationType = core::int */ { |
| constructor • = self::Foo|; |
| tearoff • = self::Foo|_#new#tearOff; |
| constructor _ = self::Foo|_; |
| tearoff _ = self::Foo|_#_#tearOff; |
| constructor redirectNamed1 = self::Foo|redirectNamed1; |
| tearoff redirectNamed1 = self::Foo|_#redirectNamed1#tearOff; |
| constructor redirectNamed2 = self::Foo|redirectNamed2; |
| tearoff redirectNamed2 = self::Foo|_#redirectNamed2#tearOff; |
| constructor named = self::Foo|named; |
| tearoff named = self::Foo|_#named#tearOff; |
| constructor erroneous = self::Foo|erroneous; |
| tearoff erroneous = self::Foo|_#erroneous#tearOff; |
| } |
| inline class Bar<T extends core::Object? = dynamic> /* declaredRepresentationType = T% */ { |
| constructor • = self::Bar|; |
| tearoff • = self::Bar|_#new#tearOff; |
| constructor _ = self::Bar|_; |
| tearoff _ = self::Bar|_#_#tearOff; |
| } |
| static inline-class-member method Foo|(core::int i) → self::Foo { |
| lowered final self::Foo #this; |
| #this = self::Foo|_(i.{core::num::+}(2){(core::num) → core::int}); |
| return #this; |
| } |
| static inline-class-member method Foo|_#new#tearOff(core::int i) → self::Foo |
| return self::Foo|(i); |
| static inline-class-member method Foo|_(core::int i) → self::Foo { |
| lowered final self::Foo #this = i; |
| return #this; |
| } |
| static inline-class-member method Foo|_#_#tearOff(core::int i) → self::Foo |
| return self::Foo|_(i); |
| static inline-class-member method Foo|redirectNamed1(core::int a, core::int b) → self::Foo { |
| lowered final self::Foo #this; |
| #this = self::Foo|named(a, subtract: b); |
| return #this; |
| } |
| static inline-class-member method Foo|_#redirectNamed1#tearOff(core::int a, core::int b) → self::Foo |
| return self::Foo|redirectNamed1(a, b); |
| static inline-class-member method Foo|redirectNamed2(core::int a, core::int b) → self::Foo { |
| lowered final self::Foo #this; |
| final core::int #t1 = b; |
| #this = self::Foo|named(a, subtract: #t1); |
| return #this; |
| } |
| static inline-class-member method Foo|_#redirectNamed2#tearOff(core::int a, core::int b) → self::Foo |
| return self::Foo|redirectNamed2(a, b); |
| static inline-class-member method Foo|named(core::int value, {required core::int subtract = #C1}) → self::Foo { |
| lowered final self::Foo #this = value.{core::num::-}(subtract){(core::num) → core::int}; |
| return #this; |
| } |
| static inline-class-member method Foo|_#named#tearOff(core::int value, {required core::int subtract}) → self::Foo |
| return self::Foo|named(value, subtract: subtract); |
| static inline-class-member method Foo|erroneous() → self::Foo { |
| lowered final self::Foo #this; |
| final dynamic #t2 = invalid-expression "pkg/front_end/testcases/inline_class/issue52119.dart:15:26: Error: Couldn't find constructor 'Foo.unresolved'. |
| Foo.erroneous() : this.unresolved(); |
| ^^^^^^^^^^"; |
| return #this; |
| } |
| static inline-class-member method Foo|_#erroneous#tearOff() → self::Foo |
| return self::Foo|erroneous(); |
| static inline-class-member method Bar|<T extends core::Object? = dynamic>(self::Bar|::T% i) → self::Bar<self::Bar|::T%> { |
| lowered final self::Bar<self::Bar|::T%> #this; |
| #this = self::Bar|_<self::Bar|::T%>(i); |
| return #this; |
| } |
| static inline-class-member method Bar|_#new#tearOff<T extends core::Object? = dynamic>(self::Bar|_#new#tearOff::T% i) → self::Bar<self::Bar|_#new#tearOff::T%> |
| return self::Bar|<self::Bar|_#new#tearOff::T%>(i); |
| static inline-class-member method Bar|_<T extends core::Object? = dynamic>(self::Bar|_::T% i) → self::Bar<self::Bar|_::T%> { |
| lowered final self::Bar<self::Bar|_::T%> #this = i; |
| return #this; |
| } |
| static inline-class-member method Bar|_#_#tearOff<T extends core::Object? = dynamic>(self::Bar|_#_#tearOff::T% i) → self::Bar<self::Bar|_#_#tearOff::T%> |
| return self::Bar|_<self::Bar|_#_#tearOff::T%>(i); |
| static method main() → dynamic { |
| self::expect(44, self::Foo|(42) as{Unchecked} core::int); |
| self::expect(42, self::Foo|_(42) as{Unchecked} core::int); |
| self::expect(3, self::Foo|redirectNamed1(5, 2) as{Unchecked} core::int); |
| self::expect(5, self::Foo|redirectNamed2(7, 2) as{Unchecked} core::int); |
| self::expect(5, self::Bar|<core::int>(5) as{Unchecked} core::int); |
| self::expect("foo", self::Bar|<core::String>("foo") as{Unchecked} core::String); |
| self::expect(5, self::Bar|_<core::int>(5) as{Unchecked} core::int); |
| self::expect("foo", self::Bar|_<core::String>("foo") as{Unchecked} core::String); |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "Expected ${expected}, actual ${actual}"; |
| } |
| |
| constants { |
| #C1 = null |
| } |