| Index: tests/language/generic_function_typedef2_test.dart
|
| diff --git a/tests/language/generic_function_typedef2_test.dart b/tests/language/generic_function_typedef2_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..86884f346c25aa9d26f068e35c82c5ca5aa52e59
|
| --- /dev/null
|
| +++ b/tests/language/generic_function_typedef2_test.dart
|
| @@ -0,0 +1,27 @@
|
| +// Copyright (c) 2012, 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 test for a function type test that cannot be eliminated at compile time.
|
| +
|
| +import "package:expect/expect.dart";
|
| +
|
| +class A {}
|
| +
|
| +typedef int F();
|
| +
|
| +typedef G = F; /// 00: compile-time error
|
| +typedef H = int; /// 01: compile-time error
|
| +typedef I = A; /// 02: compile-time error
|
| +typedef J = List<int>; /// 03: compile-time error
|
| +typedef K = Function(Function<A>(A
|
| + <int> /// 04: static type warning
|
| + ));
|
| +
|
| +main() {
|
| + bool b = true;
|
| + Expect.isFalse(b is G); /// 00: continued
|
| + Expect.isFalse(b is H); /// 01: continued
|
| + Expect.isFalse(b is I); /// 02: continued
|
| + Expect.isFalse(b is J); /// 03: continued
|
| + Expect.isFalse(b is K); /// 04: continued
|
| +}
|
|
|