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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java

Issue 49383003: Issue 14358. Check for assignment in any close. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index 83579c67f5918e3a48330ba5e4df7568c1448a42..a62ab53783aac6bb143dc92eebaeee03572e59ca 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -3146,6 +3146,21 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_typePromotion_if_inClosure_assignedAfter_inSameFunction() throws Exception {
+ Source source = addSource(createSource(//
+ "main() {",
+ " f(Object p) {",
+ " if (p is String) {",
+ " p.length;",
+ " }",
+ " p = 0;",
+ " };",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_typePromotion_if_is_and_left() throws Exception {
Source source = addSource(createSource(//
"bool tt() => true;",

Powered by Google App Engine
This is Rietveld 408576698