| library test /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart:18:73: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| // int y = /*error:INVALID_ASSIGNMENT*/ new B<String>(). /*@target=B.x*/ x; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class A<T extends core::Object? = dynamic> extends core::Object { |
| covariant-by-class field self::A::T% x = throw ""; |
| synthetic constructor •() → self::A<self::A::T%> |
| : super core::Object::•() |
| ; |
| } |
| class B<E extends core::Object? = dynamic> extends self::A<self::B::E%> { |
| covariant-by-class field self::B::E% y = throw ""; |
| synthetic constructor •() → self::B<self::B::E%> |
| : super self::A::•() |
| ; |
| get x() → self::B::E% |
| return this.{self::B::y}{self::B::E%}; |
| } |
| static method foo() → dynamic { |
| core::int y = invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart:18:73: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| int y = /*error:INVALID_ASSIGNMENT*/ new B<String>(). /*@target=B.x*/ x; |
| ^" in new self::B::•<core::String>().{self::B::x}{core::String} as{TypeError,ForNonNullableByDefault} core::int; |
| core::String z = new self::B::•<core::String>().{self::B::x}{core::String}; |
| } |
| static method main() → dynamic { |
| self::foo(); |
| } |