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

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

Issue 22881003: Implement visitCascade/visitCascadeReceiver in inferrer_visitor.dart (Closed) Base URL: https://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 | « sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.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/simple_inferrer_test.dart
diff --git a/tests/compiler/dart2js/simple_inferrer_test.dart b/tests/compiler/dart2js/simple_inferrer_test.dart
index 14ef813474694ef6c7ef24ff0fbea42073270923..eabe4c3a8840ab8b8d516c70142b9efcd432c34c 100644
--- a/tests/compiler/dart2js/simple_inferrer_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_test.dart
@@ -404,6 +404,22 @@ class B extends A {
returnInt9() => super.myField;
}
+testCascade1() {
+ return [1, 2, 3]..add(4)..add(5);
+}
+
+testCascade2() {
+ return new CascadeHelper()
+ ..a = "hello"
+ ..b = 42
+ ..i += 1;
+}
+
+class CascadeHelper {
+ var a, b;
+ var i = 0;
+}
+
main() {
// Ensure a function class is being instantiated.
() => 42;
@@ -478,6 +494,8 @@ main() {
testReturnElementOfConstList2();
testReturnItselfOrInt(topLevelGetter());
testReturnInvokeDynamicGetter();
+ testCascade1();
+ testCascade2();
}
""";
@@ -591,4 +609,8 @@ void main() {
typesInferrer.getReturnTypeOfElement(element));
}
checkFactoryConstructor('A', '');
+
+ checkReturn('testCascade1', typesTask.growableListType);
+ checkReturn('testCascade2', new TypeMask.nonNullExact(
+ typesTask.rawTypeOf(findElement(compiler, 'CascadeHelper'))));
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698