| library test; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference/map_literals_top_level.dart:11:66: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| // x1 /*@target=Map.[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w'; |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/map_literals_top_level.dart:12:66: Error: A value of type 'double' can't be assigned to a variable of type 'int'. |
| // x1 /*@target=Map.[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0] = 'u'; |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/map_literals_top_level.dart:13:61: Error: A value of type 'int' can't be assigned to a variable of type 'String'. |
| // x1 /*@target=Map.[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42; |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/map_literals_top_level.dart:20:66: Error: A value of type 'String' can't be assigned to a variable of type 'num'. |
| // x2 /*@target=Map.[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w'; |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/map_literals_top_level.dart:22:61: Error: A value of type 'int' can't be assigned to a variable of type 'Pattern'. |
| // - 'Pattern' is from 'dart:core'. |
| // x2 /*@target=Map.[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| static field core::Map<core::int*, core::String*>* x1 = <core::int*, core::String*>{1: "x", 2: "y"}; |
| static field core::Map<core::num*, core::Pattern*>* x2 = <core::num*, core::Pattern*>{1: "x", 2: "y", 3.0: core::RegExp::•(".")}; |
| static method test1() → dynamic { |
| self::x1.{core::Map::[]=}(3, "z"){(core::int*, core::String*) →* void}; |
| self::x1.{core::Map::[]=}(let final Never* #t1 = invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:11:66: Error: A value of type 'String' can't be assigned to a variable of type 'int'. |
| x1 /*@target=Map.[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w'; |
| ^" in "hi" as{TypeError} core::int*, "w"){(core::int*, core::String*) →* void}; |
| self::x1.{core::Map::[]=}(let final Never* #t2 = invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:12:66: Error: A value of type 'double' can't be assigned to a variable of type 'int'. |
| x1 /*@target=Map.[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0] = 'u'; |
| ^" in 4.0 as{TypeError} core::int*, "u"){(core::int*, core::String*) →* void}; |
| self::x1.{core::Map::[]=}(3, let final Never* #t3 = invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:13:61: Error: A value of type 'int' can't be assigned to a variable of type 'String'. |
| x1 /*@target=Map.[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42; |
| ^" in 42 as{TypeError} core::String*){(core::int*, core::String*) →* void}; |
| core::Map<core::num*, core::String*>* y = self::x1; |
| } |
| static method test2() → dynamic { |
| self::x2.{core::Map::[]=}(3, "z"){(core::num*, core::Pattern*) →* void}; |
| self::x2.{core::Map::[]=}(let final Never* #t4 = invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:20:66: Error: A value of type 'String' can't be assigned to a variable of type 'num'. |
| x2 /*@target=Map.[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w'; |
| ^" in "hi" as{TypeError} core::num*, "w"){(core::num*, core::Pattern*) →* void}; |
| self::x2.{core::Map::[]=}(4.0, "u"){(core::num*, core::Pattern*) →* void}; |
| self::x2.{core::Map::[]=}(3, let final Never* #t5 = invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:22:61: Error: A value of type 'int' can't be assigned to a variable of type 'Pattern'. |
| - 'Pattern' is from 'dart:core'. |
| x2 /*@target=Map.[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42; |
| ^" in 42 as{TypeError} core::Pattern*){(core::num*, core::Pattern*) →* void}; |
| core::Pattern* p = null; |
| self::x2.{core::Map::[]=}(2, p){(core::num*, core::Pattern*) →* void}; |
| core::Map<core::int*, core::String*>* y = self::x2 as{TypeError} core::Map<core::int*, core::String*>*; |
| } |
| static method main() → dynamic {} |