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

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

Issue 24823002: The scope of a function's signature is the function's enclosing scope, not the formal parameters sc… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 b3a5e26409c4f8568eb407846b9e40b42913b4ec..0f72d3896da1e593ad3eec2feaa790b7790ebf19 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
@@ -524,6 +524,17 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_constructorDeclaration_scope_signature() throws Exception {
+ Source source = addSource(createSource(//
+ "const app = 0;",
+ "class A {",
+ " A(@app int app) {}",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_constWithNonConstantArgument_literals() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -864,6 +875,40 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_functionDeclaration_scope_returnType() throws Exception {
+ Source source = addSource(createSource(//
+ "int f(int) {}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_functionDeclaration_scope_signature() throws Exception {
+ Source source = addSource(createSource(//
+ "const app = 0;",
+ "f(@app int app) {}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_functionTypeAlias_scope_returnType() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef int f(int);"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_functionTypeAlias_scope_signature() throws Exception {
+ Source source = addSource(createSource(//
+ "const app = 0;",
+ "typedef int f(@app int app);"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_implicitThisReferenceInInitializer_constructorName() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -1672,6 +1717,17 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_methodDeclaration_scope_signature() throws Exception {
+ Source source = addSource(createSource(//
+ "const app = 0;",
+ "class A {",
+ " foo(@app int app) {}",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_misMatchedGetterAndSetterTypes_instance_sameTypes() throws Exception {
Source source = addSource(createSource(//
"class C {",

Powered by Google App Engine
This is Rietveld 408576698