blob: 519124536559c1d8b6d2be6b6b58c8694f5939bf [file] [log] [blame]
// Formatted problems:
//
// 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));
// ^
//
// 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));
// ^
//
// 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",
// ^
//
// 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"));
// ^
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 dynamic _ = null in let final dynamic #t1 = let dynamic _ = 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 dynamic #t2 = 2.0 in null));
self::printInt(math::min<core::int>(1, let dynamic _ = null in let final dynamic #t3 = let dynamic _ = 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 dynamic #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 dynamic _ = null in let final dynamic #t5 = let dynamic _ = 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 dynamic #t6 = "hi" in null, let dynamic _ = null in let final dynamic #t7 = let dynamic _ = 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 dynamic #t8 = "there" in null));
}
static method main() → dynamic {}