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

Unified Diff: pkg/analyzer/test/generated/non_error_resolver_test.dart

Issue 688253004: Prevent conflict between parameter names and local function names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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: pkg/analyzer/test/generated/non_error_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 16d5494e336e81adeb56e184539705dd0faae9da..24150f5b5ece9a95fc7b64265883c31d86fd10be 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -3385,6 +3385,52 @@ class A {
verify([source]);
}
+ void test_parameterScope_local() {
+ // Parameter names shouldn't conflict with the name of the function they
+ // are enclosed in.
+ Source source = addSource(r'''
+f() {
+ g(g) {
+ h(g);
+ }
+}
+h(x) {}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_parameterScope_method() {
+ // Parameter names shouldn't conflict with the name of the function they
+ // are enclosed in.
+ Source source = addSource(r'''
+class C {
+ g(g) {
+ h(g);
+ }
+}
+h(x) {}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_parameterScope_toplevel() {
+ // Parameter names shouldn't conflict with the name of the function they
+ // are enclosed in.
+ Source source = addSource(r'''
+g(g) {
+ h(g);
+}
+h(x) {}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_prefixCollidesWithTopLevelMembers() {
addNamedSource("/lib.dart", r'''
library lib;
« no previous file with comments | « pkg/analyzer/test/generated/compile_time_error_code_test.dart ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698