Skip to content

call method invocation and noSuchMethod forwarder #59952

Open
@sgrekhov

Description

@sgrekhov

This issue derieved from the test mentioned in #55803 (comment). I didn't find a separate github item for this issue. Feel free to close this one as a duplicate if there is such one.

class BNSMC {
  // Should be NSM-forwarder.
  int Function(int) get call;

  Object? noSuchMethod(Invocation i) {
    if (i.memberName == #call) {
      print("isMethod=${i.isMethod}"); // false
      print("isGetter=${i.isGetter}"); // true
      return (int x) => x;
    }
    return super.noSuchMethod(i);
  }
}

void main() {
  (BNSMC() as dynamic)(42);
}

Here we have an attempt to invoke a call method, not a getter, so isMethod and isGetter should have opposite values.
cc @lrhn @eernstg to confirm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)web-dart2js

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions