blob: 60aebf5562c4aefe4ce501fa21b29c5c0fe6fd49 [file] [log] [blame]
// Copyright (c) 2021, 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.6
class A<X extends num> {
void f<Y extends X>(Y y) {}
}
expectThrows(void Function() f) {
try {
f();
} catch (e) {
return;
}
throw "Expected an exception to be thrown!";
}
main() {
A<num> a = new A<int>();
void Function<Y extends num>(Y) f = a.f;
expectThrows(() {
f(3.14);
});
}