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