blob: a4fa81e8a21178d048d2ebfabb1d13443e61ccbc [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
import "dart:math" as math;
static method printInt(core::int x) void
return core::print(x);
static method printDouble(core::double x) void
return core::print(x);
static method myMax(core::num x, core::num y) core::num
return math::max<core::num>(x, y);
static method f() dynamic {
self::printInt(math::max<core::int>(1, 2));
self::printInt(math::min<core::int>(1, 2));
self::printDouble(math::max<core::double>(1.0, 2.0));
self::printDouble(math::min<core::double>(1.0, 2.0));
self::printInt(self::myMax(1, 2) as{TypeError} core::int);
self::printInt(self::myMax(1, 2) as core::int);
self::printInt(math::max<core::int>(1, let<BottomType> _ = null in let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:28:69: 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'.
/*@typeArgs=int*/ max(1, /*@error=ArgumentTypeNotAssignable*/ 2.0));
^" in let final core::double #t2 = 2.0 in null));
self::printInt(math::min<core::int>(1, let<BottomType> _ = null in let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:30:69: 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'.
/*@typeArgs=int*/ min(1, /*@error=ArgumentTypeNotAssignable*/ 2.0));
^" in let final core::double #t4 = 2.0 in null));
self::printDouble(math::max<core::double>(1.0, 2.0));
self::printDouble(math::min<core::double>(1.0, 2.0));
self::printInt(math::min<core::int>(let<BottomType> _ = null in let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:38:44: 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'.
/*@error=ArgumentTypeNotAssignable*/ \"hi\",
^" in let final core::String #t6 = "hi" in null, let<BottomType> _ = null in let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:39:44: 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'.
/*@error=ArgumentTypeNotAssignable*/ \"there\"));
^" in let final core::String #t8 = "there" in null));
}
static method main() → dynamic {}