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

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

Issue 2862043002: Infer AsExpression types. (Closed)
Patch Set: Fixes for review comments. 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) 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 12 matching lines...) Expand all
23 import 'package:front_end/src/fasta/type_inference/type_promotion.dart'; 23 import 'package:front_end/src/fasta/type_inference/type_promotion.dart';
24 import 'package:kernel/ast.dart'; 24 import 'package:kernel/ast.dart';
25 25
26 /// Shadow object for [AsExpression]. 26 /// Shadow object for [AsExpression].
27 class KernelAsExpression extends AsExpression implements KernelExpression { 27 class KernelAsExpression extends AsExpression implements KernelExpression {
28 KernelAsExpression(Expression operand, DartType type) : super(operand, type); 28 KernelAsExpression(Expression operand, DartType type) : super(operand, type);
29 29
30 @override 30 @override
31 DartType _inferExpression( 31 DartType _inferExpression(
32 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 32 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
33 // TODO(scheglov): implement. 33 return inferrer.inferAsExpression(typeContext, typeNeeded, operand, type);
34 return typeNeeded ? const DynamicType() : null;
35 } 34 }
36 } 35 }
37 36
38 /// Shadow object for [AwaitExpression]. 37 /// Shadow object for [AwaitExpression].
39 class KernelAwaitExpression extends AwaitExpression 38 class KernelAwaitExpression extends AwaitExpression
40 implements KernelExpression { 39 implements KernelExpression {
41 KernelAwaitExpression(Expression operand) : super(operand); 40 KernelAwaitExpression(Expression operand) : super(operand);
42 41
43 @override 42 @override
44 DartType _inferExpression( 43 DartType _inferExpression(
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 // KernelVariableDeclaration. 876 // KernelVariableDeclaration.
878 mutatedInClosure = true; 877 mutatedInClosure = true;
879 declaredType = variable.type; 878 declaredType = variable.type;
880 } 879 }
881 return inferrer.inferVariableGet(typeContext, typeNeeded, mutatedInClosure, 880 return inferrer.inferVariableGet(typeContext, typeNeeded, mutatedInClosure,
882 _fact, _scope, fileOffset, declaredType, (type) { 881 _fact, _scope, fileOffset, declaredType, (type) {
883 promotedType = type; 882 promotedType = type;
884 }); 883 });
885 } 884 }
886 } 885 }
OLDNEW
« no previous file with comments | « pkg/analyzer_plugin/analyzer_plugin.iml ('k') | 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