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

Issue 9081001: Issue 991: Missing compiler errors for uninitialized final fields (Closed)

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

Description

Issue 991: Missing compiler errors for uninitialized final fields http://code.google.com/p/dart/issues/detail?id=991 -Track non initialized fields at declaration for classes -Verify they are initialized in non-redirect constructors -Check for duplicate final initialization; add tests and mark VM and Frog as failing BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2951

Patch Set 1 #

Total comments: 4

Patch Set 2 : Peter's comments + Leg status #

Total comments: 13

Patch Set 3 : Nits #

Patch Set 4 : Nits for Eric #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -6 lines) Patch
M compiler/java/com/google/dart/compiler/resolver/Resolver.java View 1 2 3 8 chunks +30 lines, -4 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tests/co19/co19-compiler.status View 1 chunk +0 lines, -1 line 0 comments Download
M tests/language/language.status View 3 chunks +7 lines, -1 line 0 comments Download
M tests/language/language-leg.status View 1 1 chunk +1 line, -0 lines 0 comments Download
A tests/language/src/ConstructorDuplicateInitializersTest.dart View 1 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
codefu
8 years, 11 months ago (2012-01-03 22:42:44 UTC) #1
ahe
Hi John, Test and status file changes: LGTM! Did you check this with leg: ./test.py ...
8 years, 11 months ago (2012-01-03 22:57:12 UTC) #2
codefu
Adding leg status changes as well. http://codereview.chromium.org/9081001/diff/1/tests/language/src/ConstructorDuplicateInitializersTest.dart File tests/language/src/ConstructorDuplicateInitializersTest.dart (right): http://codereview.chromium.org/9081001/diff/1/tests/language/src/ConstructorDuplicateInitializersTest.dart#newcode10 tests/language/src/ConstructorDuplicateInitializersTest.dart:10: , field_ = ...
8 years, 11 months ago (2012-01-04 15:18:49 UTC) #3
scheglov
lgtm with nits http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dart/compiler/resolver/Resolver.java File compiler/java/com/google/dart/compiler/resolver/Resolver.java (right): http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dart/compiler/resolver/Resolver.java#newcode180 compiler/java/com/google/dart/compiler/resolver/Resolver.java:180: private Set<String> finalsNeedingInitializing = Sets.newHashSet(); Do ...
8 years, 11 months ago (2012-01-04 15:47:26 UTC) #4
codefu
Nits taken care of. http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dart/compiler/resolver/Resolver.java File compiler/java/com/google/dart/compiler/resolver/Resolver.java (right): http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dart/compiler/resolver/Resolver.java#newcode180 compiler/java/com/google/dart/compiler/resolver/Resolver.java:180: private Set<String> finalsNeedingInitializing = Sets.newHashSet(); ...
8 years, 11 months ago (2012-01-04 15:53:11 UTC) #5
ahe
Still LGTM!
8 years, 11 months ago (2012-01-04 15:57:45 UTC) #6
zundel
LGTM, just a couple of nits http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dart/compiler/resolver/Resolver.java File compiler/java/com/google/dart/compiler/resolver/Resolver.java (right): http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dart/compiler/resolver/Resolver.java#newcode537 compiler/java/com/google/dart/compiler/resolver/Resolver.java:537: if(!initalizedFinals.add(parameter.getParameterName())) { space ...
8 years, 11 months ago (2012-01-04 16:30:38 UTC) #7
codefu
8 years, 11 months ago (2012-01-04 17:02:44 UTC) #8
http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dar...
File compiler/java/com/google/dart/compiler/resolver/Resolver.java (right):

http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/resolver/Resolver.java:562: // Test for
missing final initialized variables
On 2012/01/04 16:30:39, zundel wrote:
> I would say 'initialized fields' instead of variables.

Done.

http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/resolver/Resolver.java:564: &&
initalizedFinals.size() != this.finalsNeedingInitializing.size()) {
On 2012/01/04 16:30:39, zundel wrote:
> I don't think there's a bug here, but I'd feel more comforatable with
> initializedFinals.containsAll(finalsNeedingInitializing)

Switched to !finalsNeedingInitializing.equals(initalizedFinals)

http://codereview.chromium.org/9081001/diff/5001/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/resolver/Resolver.java:565: for(String
field : this.finalsNeedingInitializing) {
On 2012/01/04 16:30:39, zundel wrote:
> missing space after for

Done.

Powered by Google App Engine
This is Rietveld 408576698