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

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

Issue 10784020: Revert fix for type checking of void type, because some top level tests fail. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | tests/language/language_dart2js.status » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 generic types. 4 // Dart test for generic types.
5 5
6 class GenericsTest<T,V> implements Map<int, int> { 6 class GenericsTest<T,V> implements Map<int, int> {
7 static int myFunc(bool a, bool b) { 7 static int myFunc(bool a, bool b) {
8 Expect.equals(true, a); 8 Expect.equals(true, a);
9 Expect.equals(false, b); 9 Expect.equals(false, b);
10 return 42; 10 return 42;
11 } 11 }
12 12
13 static void testMain() { 13 static void testMain() {
14 int a = 1; 14 int a = 1;
15 int b = 2; 15 int b = 2;
16 int c = 3; 16 int c = 3;
17 int d = 4; 17 int d = 4;
18 Expect.equals(true, a<b); 18 Expect.equals(true, a<b);
19 Expect.equals(42, myFunc(a<b, c> d)); 19 Expect.equals(42, myFunc(a<b, c> d));
20 Map<int, int> e; 20 Map<int, int> e;
21 GenericsTest<int, GenericsTest<int, int>> f; 21 GenericsTest<int, GenericsTest<int, int>> f;
22 22
23 takesVoidMethod(void _(int a) { 23 takesVoidMethod(void _(int a) {
24 Expect.equals(2, a); 24 Expect.equals(2, a);
25 return 99;
25 }); 26 });
26 27
27 takesGenericMapMethod(Map<int, int> _(int a) { 28 takesGenericMapMethod(Map<int, int> _(int a) {
28 Expect.equals(2, a); 29 Expect.equals(2, a);
29 return null; 30 return null;
30 }); 31 });
31 32
32 takesIntMethod(int _(int a) { 33 takesIntMethod(int _(int a) {
33 Expect.equals(2, a); 34 Expect.equals(2, a);
34 return 98; 35 return 98;
35 }); 36 });
36 37
37 e = new Map(); 38 e = new Map();
38 takesMapMethod(e); 39 takesMapMethod(e);
39 Expect.equals(2, e[0]); 40 Expect.equals(2, e[0]);
40 Map h = new Map<int, int>(); 41 Map h = new Map<int, int>();
41 } 42 }
42 43
43 static void takesVoidMethod(void f(int a)) { 44 static void takesVoidMethod(void f(int a)) {
44 f(2); 45 Expect.equals(99, f(2));
45 } 46 }
46 47
47 static void takesIntMethod(int f(int a)) { 48 static void takesIntMethod(int f(int a)) {
48 Expect.equals(98, f(2)); 49 Expect.equals(98, f(2));
49 } 50 }
50 51
51 static void takesGenericMapMethod(Map<int, int> f(int a)) { 52 static void takesGenericMapMethod(Map<int, int> f(int a)) {
52 f(2); 53 f(2);
53 } 54 }
54 55
(...skipping 21 matching lines...) Expand all
76 LongGeneric< 77 LongGeneric<
77 C, 78 C,
78 List<E>, 79 List<E>,
79 Map<G, LongGeneric<I, J, List<A>>>>> id2; 80 Map<G, LongGeneric<I, J, List<A>>>>> id2;
80 } 81 }
81 } 82 }
82 83
83 main() { 84 main() {
84 GenericsTest.testMain(); 85 GenericsTest.testMain();
85 } 86 }
OLDNEW
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698