Chromium Code Reviews| Index: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart |
| diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart |
| index a12b342145f15d65d25da6cbb76c312ce0f64a07..7d154bd748d294eab48cb145f231a747ec56022d 100644 |
| --- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart |
| +++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart |
| @@ -897,7 +897,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation { |
| // Walk over the found targets, and compute the joined union type mask |
| // for all these targets. |
| - return inferrer.types.joinTypeMasks(targets.map((element) { |
| + TypeMask result = inferrer.types.joinTypeMasks(targets.map((element) { |
| // If [canReachAll] is true, then we are iterating over all |
| // targets that satisfy the untyped selector. We skip the return |
| // type of the targets that can only be reached through |
| @@ -942,6 +942,13 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation { |
| return inferrer.typeOfElementWithSelector(element, typedSelector).type; |
| } |
| })); |
| + |
| + if (call is ast.Send && (call as ast.Send).isConditional && |
|
sra1
2015/05/22 21:17:28
Avoid 'as'.
Worst case, assign to a local of the t
Siggi Cherem (dart-lang)
2015/05/22 22:36:08
Currently we can't because `call` is a field. Adde
|
| + receiver.type.isNullable) { |
| + // Conditional sends (e.g. `a?.b`) may be null if the receiver is null. |
| + result = result.nullable(); |
| + } |
| + return result; |
| } |
| void giveUp(TypeGraphInferrerEngine inferrer, {bool clearAssignments: true}) { |