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

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

Issue 22947008: Refine the type of a local after it has been used as the receiver of a call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/simple_inferrer_test.dart
===================================================================
--- tests/compiler/dart2js/simple_inferrer_test.dart (revision 26339)
+++ tests/compiler/dart2js/simple_inferrer_test.dart (working copy)
@@ -426,6 +426,21 @@
return a;
}
+testSpecialization1() {
+ var a = topLevelGetter();
+ a - 42;
+ return a;
+}
+
+testSpecialization2() {
+ var a = topLevelGetter();
+ // Make [a] a captured variable. This should disable receiver
+ // specialization on [a].
+ (() => a.toString())();
+ a - 42;
+ return a;
+}
+
testReturnInvokeDynamicGetter() => new A().myFactory();
var topLevelConstList = const [42];
@@ -565,6 +580,8 @@
testReturnInvokeDynamicGetter();
testCascade1();
testCascade2();
+ testSpecialization1();
+ testSpecialization2();
}
""";
@@ -687,4 +704,6 @@
checkReturn('testCascade1', typesTask.growableListType);
checkReturn('testCascade2', new TypeMask.nonNullExact(
typesTask.rawTypeOf(findElement(compiler, 'CascadeHelper'))));
+ checkReturn('testSpecialization1', typesTask.numType);
+ checkReturn('testSpecialization2', typesTask.dynamicType);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/world.dart ('k') | tests/language/inference_captured_variable2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698