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

Side by Side Diff: tests/language_strong/type_variable_typedef_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 4
5 // Test that rti dependency registration takes type variables within typedefs 5 // Test that rti dependency registration takes type variables within typedefs
6 // into account. 6 // into account.
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 typedef Foo<T>(T t); 10 typedef Foo<T>(T t);
11 11
12 class A<T> { 12 class A<T> {
13 m() => new B<Foo<T>>(); 13 m() => new B<Foo<T>>();
14 } 14 }
15 15
16 class B<T> { 16 class B<T> {
17 m(o) => o is T; 17 m(o) => o is T;
18 } 18 }
19 19
20 foo(int i) {} 20 foo(int i) {}
21 bar(String s) {} 21 bar(String s) {}
22 22
23 void main() { 23 void main() {
24 Expect.isTrue(new A<int>().m().m(foo)); 24 Expect.isTrue(new A<int>().m().m(foo));
25 Expect.isFalse(new A<int>().m().m(bar)); 25 Expect.isFalse(new A<int>().m().m(bar));
26 Expect.isFalse(new A<String>().m().m(foo)); 26 Expect.isFalse(new A<String>().m().m(foo));
27 Expect.isTrue(new A<String>().m().m(bar)); 27 Expect.isTrue(new A<String>().m().m(bar));
28 Expect.isFalse(new A<double>().m().m(foo)); 28 Expect.isFalse(new A<double>().m().m(foo));
29 Expect.isFalse(new A<double>().m().m(bar)); 29 Expect.isFalse(new A<double>().m().m(bar));
30 } 30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698