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

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

Issue 2917853002: Compute correct return type for factory methods. (Closed)
Patch Set: Include changes from CL 2916533003. Created 3 years, 6 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 debugEvent("NoInitializers"); 478 debugEvent("NoInitializers");
479 } 479 }
480 480
481 @override 481 @override
482 void endInitializers(int count, Token beginToken, Token endToken) { 482 void endInitializers(int count, Token beginToken, Token endToken) {
483 debugEvent("Initializers"); 483 debugEvent("Initializers");
484 } 484 }
485 485
486 DartType _computeReturnTypeContext(MemberBuilder member) { 486 DartType _computeReturnTypeContext(MemberBuilder member) {
487 if (member is KernelProcedureBuilder) { 487 if (member is KernelProcedureBuilder) {
488 if (member.target.kind == ProcedureKind.Factory) {
489 return computeFactoryConstructorReturnType(member.target);
490 }
491 return member.target.function.returnType; 488 return member.target.function.returnType;
492 } else { 489 } else {
493 assert(member is KernelConstructorBuilder); 490 assert(member is KernelConstructorBuilder);
494 return null; 491 return null;
495 } 492 }
496 } 493 }
497 494
498 @override 495 @override
499 void finishFunction( 496 void finishFunction(
500 FormalParameters formals, AsyncMarker asyncModifier, Statement body) { 497 FormalParameters formals, AsyncMarker asyncModifier, Statement body) {
(...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after
3278 if (starToken == null) { 3275 if (starToken == null) {
3279 return AsyncMarker.Async; 3276 return AsyncMarker.Async;
3280 } else { 3277 } else {
3281 assert(identical(starToken.stringValue, "*")); 3278 assert(identical(starToken.stringValue, "*"));
3282 return AsyncMarker.AsyncStar; 3279 return AsyncMarker.AsyncStar;
3283 } 3280 }
3284 } else { 3281 } else {
3285 return internalError("Unknown async modifier: $asyncToken"); 3282 return internalError("Unknown async modifier: $asyncToken");
3286 } 3283 }
3287 } 3284 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698