| library test; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:12:36: 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_top_level.dart:15:36: 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_top_level.dart:18:36: 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; |
| |
| static field core::int* x = 0; |
| static field core::int* y = 0; |
| static final field core::int* z = 42; |
| static method test1() → dynamic { |
| core::int* a = self::x; |
| a = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:12:36: 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} core::int*; |
| a = 3; |
| core::int* b = self::y; |
| b = let final Never* #t2 = invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:15:36: 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} core::int*; |
| b = 4; |
| core::int* c = self::z; |
| c = let final Never* #t3 = invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:18:36: 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} core::int*; |
| c = 4; |
| } |
| static method main() → dynamic {} |