blob: b26fec161c4faec12f57014fb0f10dc7c6651260 [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
static field core::List<core::int> x1 = <core::int>[1, 2, 3];
static field core::List<core::num> x2 = <core::num>[1, 2.0, 3];
static method test1() dynamic {
self::x1.{core::List::add}(let<BottomType> _ = null in let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:10:72: Error: The argument type 'dart.core::String' can't be assigned to the parameter type 'dart.core::int'.
Try changing the type of the parameter, or casting the argument to 'dart.core::int'.
x1. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
^" in let final core::String #t2 = "hi" in null);
self::x1.{core::List::add}(let<BottomType> _ = null in let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:11:72: Error: The argument type 'dart.core::double' can't be assigned to the parameter type 'dart.core::int'.
Try changing the type of the parameter, or casting the argument to 'dart.core::int'.
x1. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0);
^" in let final core::double #t4 = 4.0 in null);
self::x1.{core::List::add}(4);
core::List<core::num> y = self::x1;
}
static method test2() → dynamic {
self::x2.{core::List::add}(let<BottomType> _ = null in let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:18:72: Error: The argument type 'dart.core::String' can't be assigned to the parameter type 'dart.core::num'.
Try changing the type of the parameter, or casting the argument to 'dart.core::num'.
x2. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
^" in let final core::String #t6 = "hi" in null);
self::x2.{core::List::add}(4.0);
core::List<core::int> y = self::x2 as{TypeError} core::List<core::int>;
}
static method main() → dynamic {}