Skip to content

Implement InvocationMirror and use them for noSuchMethod #3326

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


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

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions