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

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

Issue 2958833003: Allocate local variable holding type arguments in generic functions in Kernel. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/language/generic_method_types_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 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. 4 // Dart test for a function type test that cannot be eliminated at compile time.
5 5
6 // VMOptions=--generic-method-syntax --no-reify-generic-functions
7
6 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
7 9
8 class A {} 10 class A {}
9 11
10 typedef F<T> = Function<S>(List<S> list, Function<A>(A), T); 12 typedef F<T> = Function<S>(List<S> list, Function<A>(A), T);
11 13
12 foo(List<dynamic> x, bar(String y), int z) {} 14 foo(List<dynamic> x, bar(String y), int z) {}
13 foo2(List<int> x, bar(String y), int z) {} 15 foo2(List<int> x, bar(String y), int z) {}
14 16
15 main() { 17 main() {
16 Expect.isTrue(foo is F); 18 Expect.isTrue(foo is F);
17 Expect.isTrue(foo is F<int>); 19 Expect.isTrue(foo is F<int>);
18 Expect.isFalse(foo is F<bool>); 20 Expect.isFalse(foo is F<bool>);
19 21
20 Expect.isTrue(foo2 is F); 22 Expect.isTrue(foo2 is F);
21 Expect.isTrue(foo2 is F<int>); 23 Expect.isTrue(foo2 is F<int>);
22 Expect.isFalse(foo2 is F<bool>); 24 Expect.isFalse(foo2 is F<bool>);
23 } 25 }
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/language/generic_method_types_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698