|
|
Initializing a final instance is a runtime error
If a final instance variable is initialized at the point of declaration, it
is a runtime error if it is initialized again in a constructor’s initializer
list or by an initializing formal.
If any instance field is initialized more than once in the initializer list of
a constructor, or by an initializing formal parameter, it is a compile time
error.
Adding a new test to cover the expected runtime error.
Fixes issue 13335.
R=regis@google.com
Committed: https://code.google.com/p/dart/source/detail?r=39562
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+149 lines, -19 lines) |
Patch |
 |
M |
runtime/vm/parser.h
|
View
|
1
|
1 chunk |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
runtime/vm/parser.cc
|
View
|
1
|
4 chunks |
+108 lines, -12 lines |
0 comments
|
Download
|
 |
M |
tests/co19/co19-co19.status
|
View
|
1
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
M |
tests/co19/co19-dart2dart.status
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tests/co19/co19-dart2js.status
|
View
|
1
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tests/co19/co19-runtime.status
|
View
|
1
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
A |
tests/language/constructor_duplicate_final_test.dart
|
View
|
|
1 chunk |
+24 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tests/language/language_analyzer.status
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tests/language/language_dart2js.status
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
Total messages: 5 (0 generated)
|