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

Issue 2939553005: Updated parser to produce error when trying to reinitialize final variables in class constructors. … (Closed)

Created:
3 years, 6 months ago by bkonyi
Modified:
3 years, 6 months ago
Reviewers:
zra, siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Updated parser to produce error when trying to reinitialize final variables in class constructors. Fixes issue #29658. BUG= R=asiva@google.com Example: Foo { final int x = 10; Foo(this.x); // Error Foo.named() : x = 42; // Error } Committed: https://github.com/dart-lang/sdk/commit/b5cff3f68f728af87f88f2f76eecfb224e303278

Patch Set 1 #

Total comments: 11

Patch Set 2 : Added test, addressed comments #

Total comments: 10

Patch Set 3 : Addressed asiva's comments #

Total comments: 6

Patch Set 4 : Addressed more of asiva's comments #

Total comments: 1

Patch Set 5 : Addressed final comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -0 lines) Patch
M runtime/vm/parser.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 3 chunks +49 lines, -0 lines 0 comments Download
A tests/language/final_attempt_reinitialization_test.dart View 1 2 1 chunk +19 lines, -0 lines 0 comments Download
M tests/language/language_analyzer2.status View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M tests/language/language_dart2js.status View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M tests/language/language_kernel.status View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
bkonyi
3 years, 6 months ago (2017-06-13 18:18:40 UTC) #2
zra
Please add some tests under //tests/language https://codereview.chromium.org/2939553005/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/2939553005/diff/1/runtime/vm/parser.cc#newcode3029 runtime/vm/parser.cc:3029: ReportError(init_pos, "'%s' is ...
3 years, 6 months ago (2017-06-13 20:19:42 UTC) #3
bkonyi
Added tests that are similar to the code snippets provided in the issue. PTAL. https://codereview.chromium.org/2939553005/diff/1/runtime/vm/parser.cc ...
3 years, 6 months ago (2017-06-13 22:16:47 UTC) #4
siva
Partial comments, I was reviewing while you updated the CL. https://codereview.chromium.org/2939553005/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/2939553005/diff/1/runtime/vm/parser.cc#newcode3027 ...
3 years, 6 months ago (2017-06-13 22:20:08 UTC) #5
siva
Have you checked your test with dart -dfe option also ? You may have to ...
3 years, 6 months ago (2017-06-13 22:37:57 UTC) #6
bkonyi
I've addressed asiva's last round of comments. PTAL. https://codereview.chromium.org/2939553005/diff/20001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/2939553005/diff/20001/runtime/vm/object.cc#newcode8174 runtime/vm/object.cc:8174: } ...
3 years, 6 months ago (2017-06-15 22:32:49 UTC) #7
siva
https://codereview.chromium.org/2939553005/diff/40001/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/2939553005/diff/40001/runtime/vm/parser.cc#newcode3030 runtime/vm/parser.cc:3030: } Pull the handle creation outside the while loop ...
3 years, 6 months ago (2017-06-16 00:51:10 UTC) #8
bkonyi
https://codereview.chromium.org/2939553005/diff/40001/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/2939553005/diff/40001/runtime/vm/parser.cc#newcode3030 runtime/vm/parser.cc:3030: } On 2017/06/16 00:51:10, siva wrote: > Pull the ...
3 years, 6 months ago (2017-06-16 19:40:45 UTC) #9
siva
lgtm https://codereview.chromium.org/2939553005/diff/60001/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/2939553005/diff/60001/runtime/vm/parser.cc#newcode5270 runtime/vm/parser.cc:5270: String& field_name = String::Handle(Z); This handle allocation could ...
3 years, 6 months ago (2017-06-19 18:11:14 UTC) #10
bkonyi
3 years, 6 months ago (2017-06-19 19:07:45 UTC) #12
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
b5cff3f68f728af87f88f2f76eecfb224e303278 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698