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

Unified Diff: tests/compiler/dart2js/union_type_test.dart

Issue 1431513010: Revert "Normalize type masks to use the least upper instantiated subclass/type." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/type_mask2_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/union_type_test.dart
diff --git a/tests/compiler/dart2js/union_type_test.dart b/tests/compiler/dart2js/union_type_test.dart
index 4ae2dac475ca8311fb8930621ab6fda7cf704c32..584ad70e0b459a97128f7e913254e81ea07c3cda 100644
--- a/tests/compiler/dart2js/union_type_test.dart
+++ b/tests/compiler/dart2js/union_type_test.dart
@@ -5,29 +5,22 @@
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
import "package:compiler/src/types/types.dart";
-import "package:compiler/src/world.dart";
-import 'type_test_helper.dart';
-main() {
+import "compiler_helper.dart";
- asyncTest(() async {
- TypeEnvironment env = await TypeEnvironment.create(r"""
- class A {}
- class B {}
- """,
- mainSource: r"""
+main() {
+ MockCompiler compiler = new MockCompiler.internal(analyzeOnly: true);
+ asyncTest(() => compiler.run(null, """
main() {
- new A();
- new B();
+ print(2); print("Hello");
}
- """,
- useMockCompiler: false);
- World world = env.compiler.world;
- world.populate();
- FlatTypeMask mask1 = new FlatTypeMask.exact(env.getElement('A'));
- FlatTypeMask mask2 = new FlatTypeMask.exact(env.getElement('B'));
- UnionTypeMask union1 = mask1.nonNullable().union(mask2, world);
- UnionTypeMask union2 = mask2.nonNullable().union(mask1, world);
+ """).then((_) {
+ FlatTypeMask mask1 =
+ new FlatTypeMask.exact(compiler.coreClasses.intClass);
+ FlatTypeMask mask2 =
+ new FlatTypeMask.exact(compiler.coreClasses.stringClass);
+ UnionTypeMask union1 = mask1.nonNullable().union(mask2, compiler.world);
+ UnionTypeMask union2 = mask2.nonNullable().union(mask1, compiler.world);
Expect.equals(union1, union2);
- });
+ }));
}
« no previous file with comments | « tests/compiler/dart2js/type_mask2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698