blob: 8e3a378c47eefd196861744fa259e898a2855bc1 [file] [log] [blame]
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:28:69: Error: The argument type 'double' can't be assigned to the parameter type 'int'.
// Try changing the type of the parameter, or casting the argument to 'int'.
// /*@typeArgs=int*/ max(1, /*@error=ArgumentTypeNotAssignable*/ 2.0));
// ^
//
// pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:30:69: Error: The argument type 'double' can't be assigned to the parameter type 'int'.
// Try changing the type of the parameter, or casting the argument to 'int'.
// /*@typeArgs=int*/ min(1, /*@error=ArgumentTypeNotAssignable*/ 2.0));
// ^
//
// pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:38:44: Error: The argument type 'String' can't be assigned to the parameter type 'int'.
// Try changing the type of the parameter, or casting the argument to 'int'.
// /*@error=ArgumentTypeNotAssignable*/ "hi",
// ^
//
// pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:39:44: Error: The argument type 'String' can't be assigned to the parameter type 'int'.
// Try changing the type of the parameter, or casting the argument to 'int'.
// /*@error=ArgumentTypeNotAssignable*/ "there"));
// ^
//
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 final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:28:69: Error: The argument type 'double' can't be assigned to the parameter type 'int'.
Try changing the type of the parameter, or casting the argument to 'int'.
/*@typeArgs=int*/ max(1, /*@error=ArgumentTypeNotAssignable*/ 2.0));
^" in 2.0 as{TypeError} core::int));
self::printInt(math::min<core::int>(1, let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:30:69: Error: The argument type 'double' can't be assigned to the parameter type 'int'.
Try changing the type of the parameter, or casting the argument to 'int'.
/*@typeArgs=int*/ min(1, /*@error=ArgumentTypeNotAssignable*/ 2.0));
^" in 2.0 as{TypeError} core::int));
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 final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:38:44: Error: The argument type 'String' can't be assigned to the parameter type 'int'.
Try changing the type of the parameter, or casting the argument to 'int'.
/*@error=ArgumentTypeNotAssignable*/ \"hi\",
^" in "hi" as{TypeError} core::int, let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:39:44: Error: The argument type 'String' can't be assigned to the parameter type 'int'.
Try changing the type of the parameter, or casting the argument to 'int'.
/*@error=ArgumentTypeNotAssignable*/ \"there\"));
^" in "there" as{TypeError} core::int));
}
static method main() → dynamic {}