| library test; |
| 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"); |
| self::x1.{core::Map::[]=}(let final dynamic #t1 = "hi" in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/map_literals_top_level.dart:14:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n x1 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';\n ^")), "w"); |
| self::x1.{core::Map::[]=}(let final dynamic #t2 = 4.0 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/map_literals_top_level.dart:15:67: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.\n x1 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0] = 'u';\n ^")), "u"); |
| self::x1.{core::Map::[]=}(3, let final dynamic #t3 = 42 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/map_literals_top_level.dart:16:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n x1 /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;\n ^"))); |
| core::Map<core::num, core::String> y = self::x1; |
| } |
| static method test2() → dynamic { |
| self::x2.{core::Map::[]=}(3, "z"); |
| self::x2.{core::Map::[]=}(let final dynamic #t4 = "hi" in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/map_literals_top_level.dart:27:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.\n x2 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';\n ^")), "w"); |
| self::x2.{core::Map::[]=}(4.0, "u"); |
| self::x2.{core::Map::[]=}(3, let final dynamic #t5 = 42 in let dynamic _ = null in const core::_ConstantExpressionError::•().{core::_ConstantExpressionError::_throw}(new core::_CompileTimeError::•("pkg/front_end/testcases/inference/map_literals_top_level.dart:29:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::Pattern'.\n x2 /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;\n ^"))); |
| core::Pattern p = null; |
| self::x2.{core::Map::[]=}(2, p); |
| core::Map<core::int, core::String> y = self::x2 as{TypeError} core::Map<core::int, core::String>; |
| } |
| static method main() → dynamic {} |