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

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

Issue 18603005: Fix send to this. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | « sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.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/cpa_inference_test.dart
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index e0f182b5cccb4f2511ece3c9db4bb252fd5bad1d..9e1262bc8941146514ac0f39f4cf109de8694516 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -465,6 +465,24 @@ testSendToThis2() {
result.checkNodeHasType('x', [result.base('B')]);
}
+testSendToThis3() {
+ final String source = r"""
+ class A {
+ bar() => 42;
+ foo() => bar();
+ }
+ class B extends A {
+ bar() => "abc";
+ }
+ main() {
+ var x = new B().foo();
+ x;
+ }
+ """;
+ AnalysisResult result = analyze(source);
+ result.checkNodeHasType('x', [result.string]);
+}
+
testConstructor() {
final String source = r"""
class A {
@@ -1462,6 +1480,7 @@ void main() {
// testSendToClosureField(); // closures are not yet supported
testSendToThis1();
testSendToThis2();
+ testSendToThis3();
testConstructor();
testGetters();
testSetters();
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698