| Index: runtime/vm/parser.cc
|
| diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
|
| index cb4bae56abe7598613b23681d1a61a701c2aed95..8dd1a560a6a16e02ffcc053886850ebc03506390 100644
|
| --- a/runtime/vm/parser.cc
|
| +++ b/runtime/vm/parser.cc
|
| @@ -989,7 +989,6 @@ SequenceNode* Parser::ParseInstanceSetter(const Function& func) {
|
|
|
| StoreInstanceFieldNode* store_field =
|
| new StoreInstanceFieldNode(ident_pos, receiver, field, value);
|
| -
|
| current_block_->statements->Add(store_field);
|
| current_block_->statements->Add(new ReturnNode(ident_pos));
|
| return CloseBlock();
|
| @@ -1801,9 +1800,10 @@ void Parser::CheckConstFieldsInitialized(const Class& cls) {
|
| SequenceNode* initializers = current_block_->statements;
|
| for (int field_num = 0; field_num < fields.Length(); field_num++) {
|
| field ^= fields.At(field_num);
|
| - if (field.is_static() || !field.is_final()) {
|
| + if (field.is_static()) {
|
| continue;
|
| }
|
| +
|
| bool found = false;
|
| for (int i = 0; i < initializers->length(); i++) {
|
| found = false;
|
| @@ -1816,9 +1816,14 @@ void Parser::CheckConstFieldsInitialized(const Class& cls) {
|
| }
|
| }
|
| }
|
| - if (!found) {
|
| +
|
| + if (found) continue;
|
| +
|
| + if (field.is_final()) {
|
| ErrorMsg("final field '%s' not initialized",
|
| String::Handle(field.name()).ToCString());
|
| + } else {
|
| + field.UpdateCid(kNullCid);
|
| }
|
| }
|
| }
|
|
|