| Index: sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (revision 21607)
|
| +++ sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (working copy)
|
| @@ -622,7 +622,12 @@
|
| }
|
|
|
| TypeMask typeOfElementWithSelector(Element element, Selector selector) {
|
| - if (selector.isGetter()) {
|
| + if (element.name == Compiler.NO_SUCH_METHOD
|
| + && selector.name != element.name) {
|
| + // An invocation can resolve to a [noSuchMethod], in which case
|
| + // we get the return type of [noSuchMethod].
|
| + return returnTypeOfElement(element);
|
| + } else if (selector.isGetter()) {
|
| if (element.isFunction()) {
|
| // [functionType] is null if the inferrer did not run.
|
| return functionType == null ? dynamicType : functionType;
|
| @@ -745,6 +750,10 @@
|
| void updateArgumentsType(FunctionElement element) {
|
| assert(hasAnalyzedAll);
|
| if (methodsThatCanBeClosurized.contains(element)) return;
|
| + // A [noSuchMethod] method can be the target of any call, with
|
| + // any number of arguments. For simplicity, we just do not
|
| + // infer any parameter types for [noSuchMethod].
|
| + if (element.name == Compiler.NO_SUCH_METHOD) return;
|
| FunctionSignature signature = element.computeSignature(compiler);
|
|
|
| if (typeOfArguments[element].isEmpty) {
|
|
|