OLD | NEW |
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 // Regression test for dart2js that used to have a bogus | 5 // Regression test for dart2js that used to have a bogus |
6 // implementation of var.== and | 6 // implementation of var.== and |
7 // var.hashCode. | 7 // var.hashCode. |
8 | 8 |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import "package:async_helper/async_helper.dart"; | 10 import "package:async_helper/async_helper.dart"; |
(...skipping 12 matching lines...) Expand all Loading... |
23 main() { | 23 main() { |
24 print(a); print(b); print(c); print(d); | 24 print(a); print(b); print(c); print(d); |
25 } | 25 } |
26 ''', | 26 ''', |
27 }; | 27 }; |
28 | 28 |
29 main() { | 29 main() { |
30 asyncTest(() async { | 30 asyncTest(() async { |
31 var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); | 31 var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); |
32 var compiler = result.compiler; | 32 var compiler = result.compiler; |
33 var typesInferrer = compiler.globalInference.typesInferrer; | 33 var typesInferrer = compiler.globalInference.typesInferrerInternal; |
34 | 34 |
35 var element = compiler.mainApp.find('a'); | 35 var element = compiler.mainApp.find('a'); |
36 var mask1 = typesInferrer.getReturnTypeOfElement(element); | 36 var mask1 = typesInferrer.getReturnTypeOfElement(element); |
37 | 37 |
38 element = compiler.mainApp.find('b'); | 38 element = compiler.mainApp.find('b'); |
39 var mask2 = typesInferrer.getReturnTypeOfElement(element); | 39 var mask2 = typesInferrer.getReturnTypeOfElement(element); |
40 | 40 |
41 element = compiler.mainApp.find('c'); | 41 element = compiler.mainApp.find('c'); |
42 var mask3 = typesInferrer.getReturnTypeOfElement(element); | 42 var mask3 = typesInferrer.getReturnTypeOfElement(element); |
43 | 43 |
44 element = compiler.mainApp.find('d'); | 44 element = compiler.mainApp.find('d'); |
45 var mask4 = typesInferrer.getReturnTypeOfElement(element); | 45 var mask4 = typesInferrer.getReturnTypeOfElement(element); |
46 | 46 |
47 Expect.notEquals(mask1.union(mask2, compiler.closedWorld), | 47 Expect.notEquals(mask1.union(mask2, compiler.closedWorld), |
48 mask3.union(mask4, compiler.closedWorld)); | 48 mask3.union(mask4, compiler.closedWorld)); |
49 }); | 49 }); |
50 } | 50 } |
OLD | NEW |