blob: f20d2fb000d5248272bfcb2ec14f6f1cce5a4266 [file] [log] [blame]
// Copyright (c) 2018, 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
Q hest<Q>(dynamic x) {
if (x is Q) return x;
return null;
}
Q Function<Q>(dynamic) pony = hest;
Q Function<Q extends Object>(dynamic) zebra = hest;
main() {
hest(42).fisk(); //# 01: runtime error
pony(42).fisk(); //# 02: runtime error
zebra(42).fisk(); //# 03: compile-time error
}