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

Side by Side Diff: pkg/kernel/testcases/reify/generic_methods_closure_test.dart

Issue 2756693002: Add generic-methods 'golden' tests for 'reify' transformation (Closed)
Patch Set: Created 3 years, 9 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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Test that a generic closure is correctly constructed.
6
7 library generic_methods_closure_test;
8
9 import "test_base.dart";
10
11 class A {}
12
13 class I<T> {}
14
15 class B extends I<B> {}
16
17 void fun<T>(List<T> list) {
18 var helper1 = <S>(List<S> list) {
19 if (list.length > 0) {
20 expectTrue(list[0] is S);
21 }
22 expectTrue(list is List<S>);
23 expectTrue(list is List<T>);
24 };
25
26 void helper2<S>(List<S> list) {
27 if (list.length > 0) {
28 expectTrue(list[0] is S);
29 }
30 expectTrue(list is List<S>);
31 expectTrue(list is List<T>);
32 }
33
34 helper1<T>(list);
35 helper2<T>(list);
36 }
37
38 main() {
39 List<B> list = <B>[new B()];
40 fun<B>(list);
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698