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

Issue 8394018: Report an error if a constructor initializer calls a setter method. (Closed)

Created:
9 years, 1 month ago by mmendez
Modified:
9 years, 1 month ago
Reviewers:
fabiomfv
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Report an error if a constructor initializer calls a setter method. BUG=http://code.google.com/p/dart/issues/detail?id=92 Committed: https://code.google.com/p/dart/source/detail?r=760

Patch Set 1 #

Total comments: 2

Patch Set 2 : Updates based on Fabio's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -2 lines) Patch
M compiler/java/com/google/dart/compiler/resolver/Resolver.java View 1 2 chunks +8 lines, -1 line 0 comments Download
M tests/language/language.status View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
mmendez
9 years, 1 month ago (2011-10-25 21:50:01 UTC) #1
fabiomfv
LGTM! minor comment. http://codereview.chromium.org/8394018/diff/1/compiler/java/com/google/dart/compiler/resolver/Resolver.java File compiler/java/com/google/dart/compiler/resolver/Resolver.java (right): http://codereview.chromium.org/8394018/diff/1/compiler/java/com/google/dart/compiler/resolver/Resolver.java#newcode1060 compiler/java/com/google/dart/compiler/resolver/Resolver.java:1060: // HACK - rely on the ...
9 years, 1 month ago (2011-10-26 14:08:17 UTC) #2
mmendez
9 years, 1 month ago (2011-10-26 17:14:58 UTC) #3
http://codereview.chromium.org/8394018/diff/1/compiler/java/com/google/dart/c...
File compiler/java/com/google/dart/compiler/resolver/Resolver.java (right):

http://codereview.chromium.org/8394018/diff/1/compiler/java/com/google/dart/c...
compiler/java/com/google/dart/compiler/resolver/Resolver.java:1060: // HACK -
rely on the fact that accessors cannot shadow a field
I'll update the comment.  I should have been clearer that this is not about the
spec.  Basically, we create field elements for both properties and fields. 
Everything works out okay because if there a was a collision between a property
and a field we'd never get here.

On 2011/10/26 14:08:17, fabiomfv wrote:
> not sure why deserves the comment as a 'hack'. dart spec states in (section
3.1)
> - though incomplete and somewhat vague, that it should be a compile error.

Powered by Google App Engine
This is Rietveld 408576698