Index: pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart |
diff --git a/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart b/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart |
index 0d2e64f9bd55cf34286f53ff99e30ec1006960bf..7d2414e5350a194c665fe37ba94c7a627a852b83 100644 |
--- a/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart |
+++ b/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart |
@@ -11,27 +11,31 @@ void printInt(int x) => print(/*@promotedType=none*/ x); |
void printDouble(double x) => print(/*@promotedType=none*/ x); |
num myMax(num x, num y) => |
- max(/*@promotedType=none*/ x, /*@promotedType=none*/ y); |
+ /*@typeArgs=num*/ max(/*@promotedType=none*/ x, /*@promotedType=none*/ y); |
f() { |
// Okay if static types match. |
- printInt(max(1, 2)); |
- printInt(min(1, 2)); |
- printDouble(max(1.0, 2.0)); |
- printDouble(min(1.0, 2.0)); |
+ printInt(/*@typeArgs=int*/ max(1, 2)); |
+ printInt(/*@typeArgs=int*/ min(1, 2)); |
+ printDouble(/*@typeArgs=double*/ max(1.0, 2.0)); |
+ printDouble(/*@typeArgs=double*/ min(1.0, 2.0)); |
// No help for user-defined functions from num->num->num. |
printInt(/*info:DOWN_CAST_IMPLICIT*/ myMax(1, 2)); |
printInt(myMax(1, 2) as int); |
// Mixing int and double means return type is num. |
- printInt(max(1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 2.0)); |
- printInt(min(1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 2.0)); |
- printDouble(max(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 1, 2.0)); |
- printDouble(min(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 1, 2.0)); |
+ printInt( |
+ /*@typeArgs=int*/ max(1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 2.0)); |
+ printInt( |
+ /*@typeArgs=int*/ min(1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 2.0)); |
+ printDouble( |
+ /*@typeArgs=double*/ max(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 1, 2.0)); |
+ printDouble( |
+ /*@typeArgs=double*/ min(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 1, 2.0)); |
// Types other than int and double are not accepted. |
- printInt(min( |
+ printInt(/*@typeArgs=int*/ min( |
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ "hi", |
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ "there")); |
} |