Chromium Code Reviews| Index: pkg/compiler/lib/src/resolution/send_resolver.dart |
| diff --git a/pkg/compiler/lib/src/resolution/send_resolver.dart b/pkg/compiler/lib/src/resolution/send_resolver.dart |
| index 77e35827ceb1f87252eb1e1ca789da3b51221940..0346cdc73161142326787b3c585b15b044f5df43 100644 |
| --- a/pkg/compiler/lib/src/resolution/send_resolver.dart |
| +++ b/pkg/compiler/lib/src/resolution/send_resolver.dart |
| @@ -224,6 +224,8 @@ abstract class SendResolverMixin { |
| return const LogicalAndStructure(); |
| } else if (operatorText == '||') { |
| return const LogicalOrStructure(); |
| + } else if (operatorText == '??') { |
| + return const IfNullStructure(); |
| } |
| } |
| @@ -510,7 +512,10 @@ abstract class SendResolverMixin { |
| } else { |
| return new StaticAccess.superMethod(element); |
| } |
| - } else if (node.isOperator) { |
| + } else if (node.isOperator || node.isConditional) { |
| + // Conditional sends (e?.x) are treated as dynamic property reads because |
| + // they are equivalent to do ((a) => a == null ? null : a.x)(e). If `e` is |
| + // a type `A`, this is equivalent to write `(A).x`. |
| return new DynamicAccess.dynamicProperty(node.receiver); |
|
Johnni Winther
2015/05/22 12:39:49
Add a TODO for me to maybe add a DynamicAccess.con
Siggi Cherem (dart-lang)
2015/05/22 19:49:54
Done.
|
| } else if (Elements.isClosureSend(node, element)) { |
| if (element == null) { |