mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:21:18 +00:00
6504f342ab
--generic_method_syntax --assert_initializer --warn_super --initializing_formal_access Change-Id: Id2e9f15b1dfecb933df97fb954618ce122cb3e4b Reviewed-on: https://dart-review.googlesource.com/15643 Reviewed-by: Zach Anderson <zra@google.com> Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Régis Crelier <regis@google.com>
26 lines
744 B
Dart
26 lines
744 B
Dart
// 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 test for a function type test that cannot be eliminated at compile time.
|
|
|
|
// VMOptions=--no-reify-generic-functions
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
class A {}
|
|
|
|
typedef F<T> = Function<S>(List<S> list, Function<A>(A), T);
|
|
|
|
foo(List<dynamic> x, bar(String y), int z) {}
|
|
foo2(List<int> x, bar(String y), int z) {}
|
|
|
|
main() {
|
|
Expect.isTrue(foo is F);
|
|
Expect.isTrue(foo is F<int>);
|
|
Expect.isFalse(foo is F<bool>);
|
|
|
|
Expect.isTrue(foo2 is F);
|
|
Expect.isTrue(foo2 is F<int>);
|
|
Expect.isFalse(foo2 is F<bool>);
|
|
}
|