Skip to content

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

Closed
rmacnak-google opened this issue Oct 3, 2013 · 9 comments
Closed
Assignees

Comments

@rmacnak-google
Copy link
Contributor

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);
}

@rmacnak-google
Copy link
Contributor Author

Marked this as blocking #6490.

@peter-ahe-google
Copy link
Contributor

How is this related to issue #6490?

@kasperl
Copy link

kasperl commented Oct 3, 2013

This looks unrelated to mirrors to me too.


Set owner to @karlklose.
Added this to the M8 milestone.
Removed Priority-Unassigned label.
Added Priority-Medium, Triaged labels.

@karlklose
Copy link
Contributor

Set owner to @johnniwinther.

@rmacnak-google
Copy link
Contributor Author

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.

@rmacnak-google
Copy link
Contributor Author

Unmarked this as blocking #6490.

@johnniwinther
Copy link
Member

Added Started label.

@johnniwinther
Copy link
Member

Implementing Function is now allowed. Warnings will be added later.


Removed this from the M8 milestone.
Added this to the Later milestone.

@johnniwinther
Copy link
Member

Fixed by https://codereview.chromium.org/26995002/


Added Fixed label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants