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

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

Issue 2950923002: Add type inference for null-aware method invocations. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 1528888cb06c7d89355eedec77e5feffa9af4bb7..fb18875ccece743e4bf35e8adc36dd3216c07591 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -38,7 +38,7 @@ import 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
import 'package:kernel/core_types.dart' show CoreTypes;
-import 'frontend_accessors.dart' show buildIsNull, makeBinary, makeLet;
+import 'frontend_accessors.dart' show buildIsNull, makeBinary;
import '../../scanner/token.dart' show BeginToken, Token;
@@ -3195,13 +3195,16 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
}
if (isNullAware) {
VariableDeclaration variable = new VariableDeclaration.forValue(receiver);
- return makeLet(
+ return new KernelNullAwareMethodInvocation(
variable,
- new KernelConditionalExpression(
+ new ConditionalExpression(
buildIsNull(new VariableGet(variable), offset),
new NullLiteral(),
new MethodInvocation(new VariableGet(variable), name, arguments)
- ..fileOffset = offset));
+ ..fileOffset = offset,
+ const DynamicType())
+ ..fileOffset = offset)
+ ..fileOffset = offset;
} else {
return new KernelMethodInvocation(receiver, name, arguments,
isImplicitCall: isImplicitCall)
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698