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

Issue 9166006: Issue 1105: Duplicate initialization should have a compile error (Closed)

Created:
8 years, 11 months ago by codefu
Modified:
8 years, 11 months ago
Reviewers:
mmendez, zundel
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Issue 1105: Duplicate initialization should have a compile error http://code.google.com/p/dart/issues/detail?id=1105 7.5.1 It is a compile-time error if more than one initializer corresponding to a given instance variable appears in k’s initializer list. It is a compile-time error if k’s initializer list contains an initializer for a variable that is initialized by means of an initializing formal of k. R=zundel,mmendez BUG=1105 TEST= Committed: https://code.google.com/p/dart/source/detail?r=3152

Patch Set 1 #

Total comments: 3

Patch Set 2 : Nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -17 lines) Patch
M compiler/java/com/google/dart/compiler/resolver/Resolver.java View 1 8 chunks +16 lines, -16 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java View 1 chunk +1 line, -0 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/NegativeResolverTest.java View 1 chunk +12 lines, -0 lines 0 comments Download
M tests/co19/co19-compiler.status View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
codefu
8 years, 11 months ago (2012-01-10 14:41:05 UTC) #1
codefu
http://codereview.chromium.org/9166006/diff/1/compiler/java/com/google/dart/compiler/resolver/Resolver.java File compiler/java/com/google/dart/compiler/resolver/Resolver.java (left): http://codereview.chromium.org/9166006/diff/1/compiler/java/com/google/dart/compiler/resolver/Resolver.java#oldcode597 compiler/java/com/google/dart/compiler/resolver/Resolver.java:597: && !finalsNeedingInitializing.equals(initalizedFinals)) { I removed this line because I ...
8 years, 11 months ago (2012-01-10 14:42:44 UTC) #2
zundel
lgtm http://codereview.chromium.org/9166006/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/9166006/diff/1/compiler/java/com/google/dart/compiler/resolver/Resolver.java#newcode562 compiler/java/com/google/dart/compiler/resolver/Resolver.java:562: Set<Element> initializedFields = Sets.newHashSet(); Could this be tightened ...
8 years, 11 months ago (2012-01-10 15:48:24 UTC) #3
codefu
http://codereview.chromium.org/9166006/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/9166006/diff/1/compiler/java/com/google/dart/compiler/resolver/Resolver.java#newcode562 compiler/java/com/google/dart/compiler/resolver/Resolver.java:562: Set<Element> initializedFields = Sets.newHashSet(); On 2012/01/10 15:48:24, zundel wrote: ...
8 years, 11 months ago (2012-01-10 15:51:02 UTC) #4
mmendez
8 years, 11 months ago (2012-01-10 16:28:23 UTC) #5
lgtm

Might as well tighten if you can.

On 2012/01/10 15:51:02, codefu wrote:
>
http://codereview.chromium.org/9166006/diff/1/compiler/java/com/google/dart/c...
> File compiler/java/com/google/dart/compiler/resolver/Resolver.java (right):
> 
>
http://codereview.chromium.org/9166006/diff/1/compiler/java/com/google/dart/c...
> compiler/java/com/google/dart/compiler/resolver/Resolver.java:562:
Set<Element>
> initializedFields = Sets.newHashSet();
> On 2012/01/10 15:48:24, zundel wrote:
> > Could this be tightened to a FieldElement?
> 
> I tried, but the call to resolveInitializers() looks at:
> initializer.getName().getTargetSymbol()
> which returns just an Element. I could cast at that point and tighten up the
set
> though.  Opinions?

Powered by Google App Engine
This is Rietveld 408576698