Chromium Code Reviews| Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart |
| diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
| index 75535faa7df093f1237ef6cac8eba245a83acf35..10c1659f81581c83c0dec373214bfd3401552acd 100644 |
| --- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
| +++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
| @@ -1838,8 +1838,12 @@ class CodeGenerator extends Object |
| // |
| // For the same reason, we can ignore "noSuchMethod". |
| // call-implemented-by-nSM will be dispatched by dcall at runtime. |
|
vsm
2017/07/14 14:19:56
Remove or update the two lines above?
Jennifer Messerly
2017/07/14 18:40:20
they're still accurate but i'll try and clarify:
|
| - bool isCallable = classElem.lookUpMethod('call', null) != null || |
| - classElem.lookUpGetter('call', null)?.returnType is FunctionType; |
| + // For classes that implement a callable interface with nSM, we'll find |
| + // the "call" when we search the type for inherited "call" members. |
| + var callMethod = classElem.type.lookUpInheritedGetterOrMethod('call'); |
| + bool isCallable = callMethod is PropertyAccessorElement |
| + ? callMethod.returnType is FunctionType |
| + : callMethod != null; |
| var body = <JS.Statement>[]; |
| void addConstructor(ConstructorElement element, JS.Expression jsCtor) { |