| library test /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:13:38: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| // a = /*error:INVALID_ASSIGNMENT*/ "hi"; |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:16:38: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| // b = /*error:INVALID_ASSIGNMENT*/ "hi"; |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:19:38: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| // c = /*error:INVALID_ASSIGNMENT*/ "hi"; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class A extends core::Object { |
| field core::int x = 0; |
| field core::int y = throw ""; |
| final field core::int z = 42; |
| synthetic constructor •() → self::A |
| : super core::Object::•() |
| ; |
| method test1() → dynamic { |
| core::int a = this.{self::A::x}{core::int}; |
| a = invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:13:38: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| a = /*error:INVALID_ASSIGNMENT*/ \"hi\"; |
| ^" in "hi" as{TypeError,ForNonNullableByDefault} core::int; |
| a = 3; |
| core::int b = this.{self::A::y}{core::int}; |
| b = invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:16:38: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| b = /*error:INVALID_ASSIGNMENT*/ \"hi\"; |
| ^" in "hi" as{TypeError,ForNonNullableByDefault} core::int; |
| b = 4; |
| core::int c = this.{self::A::z}{core::int}; |
| c = invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:19:38: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| c = /*error:INVALID_ASSIGNMENT*/ \"hi\"; |
| ^" in "hi" as{TypeError,ForNonNullableByDefault} core::int; |
| c = 4; |
| } |
| } |
| static method main() → dynamic {} |