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

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

Issue 2946943002: Record static types in the desugaring of null-aware property gets. (Closed)
Patch Set: Fix inference of receiver type 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/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 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 1443
1444 @override 1444 @override
1445 void _collectDependencies(KernelDependencyCollector collector) { 1445 void _collectDependencies(KernelDependencyCollector collector) {
1446 // Null aware expressions are not immediately evident. 1446 // Null aware expressions are not immediately evident.
1447 collector.recordNotImmediatelyEvident(fileOffset); 1447 collector.recordNotImmediatelyEvident(fileOffset);
1448 } 1448 }
1449 1449
1450 @override 1450 @override
1451 DartType _inferExpression( 1451 DartType _inferExpression(
1452 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 1452 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
1453 return inferrer.inferPropertyGet(this, variable.initializer, fileOffset, 1453 var inferredType = inferrer.inferPropertyGet(this, variable.initializer,
1454 _desugaredGet, typeContext, typeNeeded); 1454 fileOffset, _desugaredGet, typeContext, true,
1455 receiverVariable: variable);
1456 body.staticType = inferredType;
1457 return inferredType;
1455 } 1458 }
1456 } 1459 }
1457 1460
1458 /// Concrete shadow object representing a null literal in kernel form. 1461 /// Concrete shadow object representing a null literal in kernel form.
1459 class KernelNullLiteral extends NullLiteral implements KernelExpression { 1462 class KernelNullLiteral extends NullLiteral implements KernelExpression {
1460 @override 1463 @override
1461 void _collectDependencies(KernelDependencyCollector collector) { 1464 void _collectDependencies(KernelDependencyCollector collector) {
1462 // No inference dependencies. 1465 // No inference dependencies.
1463 } 1466 }
1464 1467
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 } 2286 }
2284 2287
2285 transformChildren(v) { 2288 transformChildren(v) {
2286 return internalError("Internal error: Unsupported operation."); 2289 return internalError("Internal error: Unsupported operation.");
2287 } 2290 }
2288 2291
2289 visitChildren(v) { 2292 visitChildren(v) {
2290 return internalError("Internal error: Unsupported operation."); 2293 return internalError("Internal error: Unsupported operation.");
2291 } 2294 }
2292 } 2295 }
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