Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: tests/language/generic_function_typedef_test.dart

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fixes after rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
ahe 2017/04/27 12:50:20 Wrong year.
floitsch 2017/04/27 13:24:52 done in https://codereview.chromium.org/2850473002
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 // Dart test for a function type test that cannot be eliminated at compile time.
5
6 import "package:expect/expect.dart";
7
8 class A {
9 }
10
11 typedef F<T> = Function<S>(List<S> list, Function<A>(A), T);
12
13 foo(List<dynamic> x, bar(String y), int z) {}
14 foo2(List<int> x, bar(String y), int z) {}
15
16 main() {
17 Expect.isTrue(foo is F);
18 Expect.isTrue(foo is F<int>);
19 Expect.isFalse(foo is F<bool>);
20
21 Expect.isTrue(foo2 is F);
22 Expect.isTrue(foo2 is F<int>);
23 Expect.isFalse(foo2 is F<bool>);
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698