-
Notifications
You must be signed in to change notification settings - Fork 1.7k
dart2js: implementing Function without defining call should be a warning #13766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Marked this as blocking #6490. |
How is this related to issue #6490? |
This looks unrelated to mirrors to me too. Set owner to @karlklose. |
Set owner to @johnniwinther. |
I wanted to implement ObjectMirror's subscript operator in terms of a fake function that supported the various arities by using noSuchMethod. I forgot that on dart2js the presence of noSuchMethod is expensive and we shouldn't use in core libs. |
Unmarked this as blocking #6490. |
Added Started label. |
Fixed by https://codereview.chromium.org/26995002/ Added Fixed label. |
dart2js currently gives an error when attempting to implement Function. The spec (15.5) says this is a static warning.
import 'dart:mirrors';
class _InvocationTrampoline implements Function {
ObjectMirror _receiver;
Symbol _selector;
_InvocationTrampoline(this._receiver, this._selector);
noSuchMethod(Invocation msg) {
if (msg.memberName != #call) return super.noSuchMethod(msg);
return _receiver.invoke(_selector, msg.positionalArguments, msg.namedArguments);
}
}
main(){
print(new _InvocationTrampoline(reflect(0), #toString) is Function);
}
The text was updated successfully, but these errors were encountered: