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

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

Issue 2916533003: Set return type of factory constructors properly. (Closed)
Patch Set: 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
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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 debugEvent("NoInitializers"); 475 debugEvent("NoInitializers");
476 } 476 }
477 477
478 @override 478 @override
479 void endInitializers(int count, Token beginToken, Token endToken) { 479 void endInitializers(int count, Token beginToken, Token endToken) {
480 debugEvent("Initializers"); 480 debugEvent("Initializers");
481 } 481 }
482 482
483 DartType _computeReturnTypeContext(MemberBuilder member) { 483 DartType _computeReturnTypeContext(MemberBuilder member) {
484 if (member is KernelProcedureBuilder) { 484 if (member is KernelProcedureBuilder) {
485 if (member.target.kind == ProcedureKind.Factory) {
486 return computeFactoryConstructorReturnType(member.target);
487 }
ahe 2017/06/01 09:10:08 I have to "steal" this :-)
488 return member.target.function.returnType; 485 return member.target.function.returnType;
489 } else { 486 } else {
490 assert(member is KernelConstructorBuilder); 487 assert(member is KernelConstructorBuilder);
491 return null; 488 return null;
492 } 489 }
493 } 490 }
494 491
495 @override 492 @override
496 void finishFunction( 493 void finishFunction(
497 FormalParameters formals, AsyncMarker asyncModifier, Statement body) { 494 FormalParameters formals, AsyncMarker asyncModifier, Statement body) {
(...skipping 2737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3235 if (starToken == null) { 3232 if (starToken == null) {
3236 return AsyncMarker.Async; 3233 return AsyncMarker.Async;
3237 } else { 3234 } else {
3238 assert(identical(starToken.stringValue, "*")); 3235 assert(identical(starToken.stringValue, "*"));
3239 return AsyncMarker.AsyncStar; 3236 return AsyncMarker.AsyncStar;
3240 } 3237 }
3241 } else { 3238 } else {
3242 return internalError("Unknown async modifier: $asyncToken"); 3239 return internalError("Unknown async modifier: $asyncToken");
3243 } 3240 }
3244 } 3241 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698