blob: 2e7f93572644adf039d1959927271fe26bc6de37 [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// @dart=2.9
/*@testedFeatures=inference*/
library test;
import 'dart:math';
// T max<T extends num>(T x, T y);
f() {
num x;
dynamic y;
num a = /*@ typeArgs=num* */ max(
x,
/*info:DYNAMIC_CAST*/ y);
Object b = /*@ typeArgs=num* */ max(
x,
/*info:DYNAMIC_CAST*/ y);
dynamic c = /*error:COULD_NOT_INFER*/ /*@ typeArgs=dynamic */ max(x, y);
var /*@ type=dynamic */ d = /*error:COULD_NOT_INFER*/ /*@ typeArgs=dynamic */ max(
x, y);
}
main() {}