OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart'; | 6 import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart'; |
7 import "compiler_helper.dart"; | 7 import "compiler_helper.dart"; |
8 import "parser_helper.dart"; | 8 import "parser_helper.dart"; |
9 | 9 |
10 bool test(compiler, String name1, String name2, {bool expect}) { | 10 bool test(compiler, String name1, String name2, {bool expect}) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 type2 = signature2.requiredParameters.head.computeType(compiler); | 43 type2 = signature2.requiredParameters.head.computeType(compiler); |
44 } | 44 } |
45 if (expect) { | 45 if (expect) { |
46 Expect.equals(type1, type2, "$type1 != $type2"); | 46 Expect.equals(type1, type2, "$type1 != $type2"); |
47 } else { | 47 } else { |
48 Expect.notEquals(type1, type2, "$type1 == $type2"); | 48 Expect.notEquals(type1, type2, "$type1 == $type2"); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 void main() { | 52 void main() { |
53 var uri = new Uri.fromComponents(scheme: 'source'); | 53 var uri = new Uri(scheme: 'source'); |
54 var compiler = compilerFor( | 54 var compiler = compilerFor( |
55 r""" | 55 r""" |
56 typedef int Typedef1<X,Y>(String s1); | 56 typedef int Typedef1<X,Y>(String s1); |
57 typedef void Typedef2<Z>(T t1, S s1); | 57 typedef void Typedef2<Z>(T t1, S s1); |
58 | 58 |
59 class Class<T,S> { | 59 class Class<T,S> { |
60 void void1() {} | 60 void void1() {} |
61 void void2() {} | 61 void void2() {} |
62 void int1(int a) {} | 62 void int1(int a) {} |
63 void int2(int b) {} | 63 void int2(int b) {} |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 test(compiler, "String1", "ListInt1", expect: false); | 107 test(compiler, "String1", "ListInt1", expect: false); |
108 test(compiler, "ListInt1", "ListString1", expect: false); | 108 test(compiler, "ListInt1", "ListString1", expect: false); |
109 test(compiler, "ListString1", "MapIntString1", expect: false); | 109 test(compiler, "ListString1", "MapIntString1", expect: false); |
110 test(compiler, "MapIntString1", "TypeVar1", expect: false); | 110 test(compiler, "MapIntString1", "TypeVar1", expect: false); |
111 test(compiler, "TypeVar1", "Function1a", expect: false); | 111 test(compiler, "TypeVar1", "Function1a", expect: false); |
112 test(compiler, "Function1a", "Function1b", expect: false); | 112 test(compiler, "Function1a", "Function1b", expect: false); |
113 test(compiler, "Function1b", "Typedef1a", expect: false); | 113 test(compiler, "Function1b", "Typedef1a", expect: false); |
114 test(compiler, "Typedef1a", "Typedef1b", expect: false); | 114 test(compiler, "Typedef1a", "Typedef1b", expect: false); |
115 test(compiler, "Typedef1b", "Typedef1c", expect: false); | 115 test(compiler, "Typedef1b", "Typedef1c", expect: false); |
116 } | 116 } |
OLD | NEW |