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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2905123002: Perform type inference on explicitly typed fields. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; 8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody;
9 9
10 import '../parser/parser.dart' show FormalParameterType, MemberKind, optional; 10 import '../parser/parser.dart' show FormalParameterType, MemberKind, optional;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } else { 359 } else {
360 field = library[name]; 360 field = library[name];
361 } 361 }
362 if (field.next != null) { 362 if (field.next != null) {
363 // TODO(ahe): This can happen, for example, if a final field is 363 // TODO(ahe): This can happen, for example, if a final field is
364 // combined with a setter. 364 // combined with a setter.
365 internalError( 365 internalError(
366 "Unhandled: '${field.name}' has more than one declaration."); 366 "Unhandled: '${field.name}' has more than one declaration.");
367 } 367 }
368 field.initializer = initializer; 368 field.initializer = initializer;
369 _typeInferrer.inferFieldInitializer(field.builtType, initializer);
369 } 370 }
370 } 371 }
371 pop(); // Type. 372 pop(); // Type.
372 pop(); // Modifiers. 373 pop(); // Modifiers.
373 } 374 }
374 375
375 @override 376 @override
376 void endMember() { 377 void endMember() {
377 debugEvent("Member"); 378 debugEvent("Member");
378 checkEmpty(-1); 379 checkEmpty(-1);
(...skipping 2799 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 if (starToken == null) { 3179 if (starToken == null) {
3179 return AsyncMarker.Async; 3180 return AsyncMarker.Async;
3180 } else { 3181 } else {
3181 assert(identical(starToken.stringValue, "*")); 3182 assert(identical(starToken.stringValue, "*"));
3182 return AsyncMarker.AsyncStar; 3183 return AsyncMarker.AsyncStar;
3183 } 3184 }
3184 } else { 3185 } else {
3185 return internalError("Unknown async modifier: $asyncToken"); 3186 return internalError("Unknown async modifier: $asyncToken");
3186 } 3187 }
3187 } 3188 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/field_builder.dart ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_field_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698