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

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

Issue 23353002: Fix receiver refining optimization in the presence of null: any Object method can be called on the … (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
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/language/refine_receiver_null_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/simple_inferrer_test.dart
===================================================================
--- tests/compiler/dart2js/simple_inferrer_test.dart (revision 26345)
+++ tests/compiler/dart2js/simple_inferrer_test.dart (working copy)
@@ -441,6 +441,14 @@
return a;
}
+testSpecialization3() {
+ var a = returnDynamic() ? null : 42;
+ a.toString();
+ // Test that calling an [Object] method on [a] will not lead to
+ // infer that [a] is not null;
+ return a;
+}
+
testReturnInvokeDynamicGetter() => new A().myFactory();
var topLevelConstList = const [42];
@@ -582,6 +590,7 @@
testCascade2();
testSpecialization1();
testSpecialization2();
+ testSpecialization3();
}
""";
@@ -706,4 +715,5 @@
typesTask.rawTypeOf(findElement(compiler, 'CascadeHelper'))));
checkReturn('testSpecialization1', typesTask.numType);
checkReturn('testSpecialization2', typesTask.dynamicType);
+ checkReturn('testSpecialization3', typesTask.intType.nullable());
}
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/language/refine_receiver_null_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698