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

Issue 688253004: Prevent conflict between parameter names and local function names. (Closed)

Created:
6 years, 1 month ago by Paul Berry
Modified:
6 years, 1 month ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Prevent conflict between parameter names and local function names. From section 9.2 (Formal Parameters) of the spec: The formal parameter list of a function introduces a new scope known as the function's formal parameter scope. The formal parameter scope of a function f is enclosed in the scope where f is declared. Therefore, if one of the function's parameters has the same name as the function itself, that isn't a problem. Previously, we would add a local function to its own formal parameter scope before visiting it (to allow it to call itself recursively), and then after visiting it we would add it to the scope of the enclosing function (so that the enclosing function could call it). The fix is to add the local function just to the scope of the enclosing function, and to do it before visiting the local function so that recursion still works. BUG=dartbug.com/20074 R=brianwilkerson@google.com Committed: https://code.google.com/p/dart/source/detail?r=41621

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -32 lines) Patch
M pkg/analyzer/lib/src/generated/resolver.dart View 3 chunks +4 lines, -9 lines 0 comments Download
M pkg/analyzer/test/generated/compile_time_error_code_test.dart View 1 chunk +0 lines, -20 lines 0 comments Download
M pkg/analyzer/test/generated/non_error_resolver_test.dart View 1 chunk +46 lines, -0 lines 0 comments Download
M tests/language/language_analyzer2.status View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
Paul Berry
6 years, 1 month ago (2014-11-07 22:11:50 UTC) #2
Brian Wilkerson
LGTM
6 years, 1 month ago (2014-11-07 22:39:31 UTC) #3
Paul Berry
6 years, 1 month ago (2014-11-08 01:11:26 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as 41621 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698