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

Unified Diff: tests/language/type_promotion_closure_test.dart

Issue 85633002: Handle parenthesized expression in type promotion. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix comments. Created 7 years, 1 month 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/language/type_promotion_closure_test.dart
diff --git a/tests/language/type_promotion_closure_test.dart b/tests/language/type_promotion_closure_test.dart
index bb514daaf2196a180dbd4b8ccf3f9f6da6c4db1d..5c594439f65d03d3f6bedf6fcbd86097fea1a7e6 100644
--- a/tests/language/type_promotion_closure_test.dart
+++ b/tests/language/type_promotion_closure_test.dart
@@ -30,9 +30,11 @@ void main() {
test1();
test2();
test3();
+ test3a();
test4();
test5();
test6();
+ test6a();
test7();
test8();
test9();
@@ -79,6 +81,22 @@ void test3() {
}
}
+void test3a() {
+ A a = new E();
+ void foo() {
+ a = new D();
+ }
+ if ((((a)) is B)) {
+ print(a.a);
+ print(a.b); /// 15: static type warning
+ void foo() {
+ a = new D();
+ }
+ print(a.a);
+ print(a.b); /// 16: static type warning
+ }
+}
+
void test4() {
A a = new E();
if (a is B) {
@@ -107,6 +125,16 @@ void test6() {
a = null;
}
+void test6a() {
+ A a = new E();
+ if (((a) is B)) {
+ func(() => a);
+ print(a.a);
+ print(a.b); /// 14: static type warning
+ }
+ a = null;
+}
+
void test7() {
A a = new E();
if (a is B && func(() => a)) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/typechecker.dart ('k') | tests/language/type_promotion_logical_and_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698