| Index: lib/compiler/implementation/ssa/optimize.dart
|
| diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart
|
| index 9b8dc6666dce10a2cd1058265fc7567395a6e208..c19202f4477c2d68714b1786bcc35f83c30cd835 100644
|
| --- a/lib/compiler/implementation/ssa/optimize.dart
|
| +++ b/lib/compiler/implementation/ssa/optimize.dart
|
| @@ -196,7 +196,17 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
|
| }
|
|
|
| if (!input.canBePrimitive() && !node.getter && !node.setter) {
|
| - return fromInterceptorToDynamicInvocation(node, node.name);
|
| + bool transformToDynamicInvocation = true;
|
| + if (input.canBeNull()) {
|
| + // Check if the method exists on Null. If yes we must not transform
|
| + // the static interceptor call to a dynamic invocation.
|
| + // TODO(floitsch): get a list of methods that exist on 'null' and only
|
| + // bail out on them.
|
| + transformToDynamicInvocation = false;
|
| + }
|
| + if (transformToDynamicInvocation) {
|
| + return fromInterceptorToDynamicInvocation(node, node.name);
|
| + }
|
| }
|
|
|
| return node;
|
|
|