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

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

Issue 2958363002: Adjust return types of spec-mode function expressions to match VM. (Closed)
Patch Set: Created 3 years, 5 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/type_inference/type_inferrer.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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /// This file declares a "shadow hierarchy" of concrete classes which extend 5 /// This file declares a "shadow hierarchy" of concrete classes which extend
6 /// the kernel class hierarchy, adding methods and fields needed by the 6 /// the kernel class hierarchy, adding methods and fields needed by the
7 /// BodyBuilder. 7 /// BodyBuilder.
8 /// 8 ///
9 /// Instances of these classes may be created using the factory methods in 9 /// Instances of these classes may be created using the factory methods in
10 /// `ast_factory.dart`. 10 /// `ast_factory.dart`.
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 implements KernelStatement { 800 implements KernelStatement {
801 bool _hasImplicitReturnType = false; 801 bool _hasImplicitReturnType = false;
802 802
803 KernelFunctionDeclaration(VariableDeclaration variable, FunctionNode function) 803 KernelFunctionDeclaration(VariableDeclaration variable, FunctionNode function)
804 : super(variable, function); 804 : super(variable, function);
805 805
806 @override 806 @override
807 void _inferStatement(KernelTypeInferrer inferrer) { 807 void _inferStatement(KernelTypeInferrer inferrer) {
808 inferrer.listener.functionDeclarationEnter(this); 808 inferrer.listener.functionDeclarationEnter(this);
809 inferrer.inferLocalFunction(function, null, false, fileOffset, 809 inferrer.inferLocalFunction(function, null, false, fileOffset,
810 _hasImplicitReturnType ? null : function.returnType, true); 810 _hasImplicitReturnType ? null : function.returnType);
811 variable.type = function.functionType; 811 variable.type = function.functionType;
812 inferrer.listener.functionDeclarationExit(this); 812 inferrer.listener.functionDeclarationExit(this);
813 } 813 }
814 814
815 static void setHasImplicitReturnType( 815 static void setHasImplicitReturnType(
816 KernelFunctionDeclaration declaration, bool hasImplicitReturnType) { 816 KernelFunctionDeclaration declaration, bool hasImplicitReturnType) {
817 declaration._hasImplicitReturnType = hasImplicitReturnType; 817 declaration._hasImplicitReturnType = hasImplicitReturnType;
818 } 818 }
819 } 819 }
820 820
(...skipping 23 matching lines...) Expand all
844 collector.recordNotImmediatelyEvident(fileOffset); 844 collector.recordNotImmediatelyEvident(fileOffset);
845 } 845 }
846 } 846 }
847 847
848 @override 848 @override
849 DartType _inferExpression( 849 DartType _inferExpression(
850 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 850 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
851 typeNeeded = inferrer.listener.functionExpressionEnter(this, typeContext) || 851 typeNeeded = inferrer.listener.functionExpressionEnter(this, typeContext) ||
852 typeNeeded; 852 typeNeeded;
853 var inferredType = inferrer.inferLocalFunction( 853 var inferredType = inferrer.inferLocalFunction(
854 function, typeContext, typeNeeded, fileOffset, null, false); 854 function, typeContext, typeNeeded, fileOffset, null);
855 inferrer.listener.functionExpressionExit(this, inferredType); 855 inferrer.listener.functionExpressionExit(this, inferredType);
856 return inferredType; 856 return inferredType;
857 } 857 }
858 } 858 }
859 859
860 /// Concrete shadow object representing an if-null expression. 860 /// Concrete shadow object representing an if-null expression.
861 /// 861 ///
862 /// An if-null expression of the form `a ?? b` is represented as the kernel 862 /// An if-null expression of the form `a ?? b` is represented as the kernel
863 /// expression: 863 /// expression:
864 /// 864 ///
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 } 2357 }
2358 2358
2359 transformChildren(v) { 2359 transformChildren(v) {
2360 return internalError("Internal error: Unsupported operation."); 2360 return internalError("Internal error: Unsupported operation.");
2361 } 2361 }
2362 2362
2363 visitChildren(v) { 2363 visitChildren(v) {
2364 return internalError("Internal error: Unsupported operation."); 2364 return internalError("Internal error: Unsupported operation.");
2365 } 2365 }
2366 } 2366 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698