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

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

Issue 16188008: Handle fields/getter of mixed-in classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync and fix wording in comment Created 7 years, 6 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 905b5fde27f16bf83cc2f27bc8d47549d59696e3..493a8b7be634fd29357600585ef633499d7316f2 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -1335,6 +1335,32 @@ testSelectors() {
Expect.isNull(inferredType(bar));
}
+testMixins() {
+ final String source = r"""
+ class A {
+ foo() => "abc";
+ get x => 42;
+ }
+ class B extends Object with A {
+ bar() => foo();
+ baz() => x;
+ }
+ main() {
+ var b = new B();
+ var x = b.foo();
+ var y = b.bar();
+ var z = b.x;
+ var w = b.baz();
+ x; y; z; w;
+ }
+ """;
+ AnalysisResult result = analyze(source);
+ result.checkNodeHasType('x', [result.string]);
+ result.checkNodeHasType('y', [result.string]);
+ result.checkNodeHasType('z', [result.int]);
+ result.checkNodeHasType('w', [result.int]);
+}
+
void main() {
testDynamicBackDoor();
testVariableDeclaration();
@@ -1386,4 +1412,5 @@ void main() {
testIntDoubleNum();
testConcreteTypeToTypeMask();
testSelectors();
+ testMixins();
}
« 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