Skip to content
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

Implement InvocationMirror and use them for noSuchMethod #3326

Closed
DartBot opened this issue May 31, 2012 · 15 comments
Closed

Implement InvocationMirror and use them for noSuchMethod #3326

DartBot opened this issue May 31, 2012 · 15 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Milestone

Comments

@DartBot
Copy link

DartBot commented May 31, 2012

This issue was originally filed by ms...@unipro.ru


The specification in the section 10.14.1 says: "If getter lookup has also failed, then a new instance im of the predefined interface InvocationMirror is created by calling its factory constructor with arguments ‘m’, this, [o1, …, on] and {xn+1:on+1, …, xn+k : on+k}. Then the method noSuchMethod() is looked up in o and invoked with argument im, and the result of this invocation is the result of evaluating i."

The following test produces a static warning in dartc (r8145):

class A {
  noSuchMethod(InvocationMirror im) { //static warning: 'no such type
                                      //"InvocationMirror"'
    return "v";
  }
}

main() {
  var classWithoutMethod = new A();
  Expect.equals("v", classWithoutMethod.m());
}

@madsager
Copy link
Contributor

Mirrors are currently not implemented, so this is the expected behavior. The implementations of the language are not completely up to speed with respect to the spec.

Updating bug report summary.


Added Area-VM, Triaged labels.
Changed the title to: "Implement InvocationMirror and use them for noSuchMethod".

@iposva-google
Copy link
Contributor

Set owner to @turnidge.
Added Accepted label.

@danrubel
Copy link

Marked this as blocking #3524.

@ghost
Copy link

ghost commented Aug 29, 2012

Issue #1346 has been merged into this issue.

@scheglov
Copy link
Contributor

Marked this as blocking #5294.

@lrhn
Copy link
Member

lrhn commented Nov 23, 2012

Issue #6887 has been merged into this issue.

@kasperl
Copy link

kasperl commented Dec 11, 2012

Issue #3565 has been merged into this issue.

@kasperl
Copy link

kasperl commented Dec 11, 2012

Looks like the InvocationMirror is missing named arguments. Not fixed yet.


Added this to the M2 milestone.

@iposva-google
Copy link
Contributor

As far as I can tell this is fixed with r15939. Regis?


Set owner to @crelier.

@crelier
Copy link
Contributor

crelier commented Dec 11, 2012

Correct.


Added Fixed label.

@kasperl
Copy link

kasperl commented Dec 13, 2012

Awesome!

@DartBot
Copy link
Author

DartBot commented Dec 17, 2012

This comment was originally written by rodion...@unipro.ru


this still fails:

class TestException {}

class A {
  noSuchMethod(InvocationMirror im) {
    print(im.memberName);
    Expect.equals('call', im.memberName);
    throw new TestException();
  }
}

class C {
  var func;
}

main() {
  var o = new C();
  o.func = new A();
  try {
    o.func();
    Expect.fail("TestException is expected");
  } on TestException catch(e) {}
}

It still shows a NoSuchMethodError, but it comes from Object (I guess):

Unhandled exception:
NoSuchMethodError : method not found: 'call'
Receiver: Instance of 'A'
Arguments: []

@DartBot
Copy link
Author

DartBot commented Dec 17, 2012

This comment was originally written by rodion...@unipro.ru


that's
Language/11_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t02 and
Language/11_Expressions/15_Method_Invocation/1_Ordinary_Invocation_A05_t03 in co19

@crelier
Copy link
Contributor

crelier commented Dec 17, 2012

Removed this from the M2 milestone.
Added this to the M3 milestone.
Added Started label.

@crelier
Copy link
Contributor

crelier commented Dec 17, 2012

Fixed in r16220.


Added Fixed label.

@DartBot DartBot added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Dec 17, 2012
@DartBot DartBot added this to the M3 milestone Dec 17, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

8 participants