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

Symbol for setter in dynamic calls appears to be incorrect #29486

Closed
jmesserly opened this issue Apr 26, 2017 · 2 comments
Closed

Symbol for setter in dynamic calls appears to be incorrect #29486

jmesserly opened this issue Apr 26, 2017 · 2 comments
Labels
P2 A bug or feature request we're likely to work on web-dev-compiler

Comments

@jmesserly
Copy link

DDC does not appear to be using the correct symbol. Also our NoSuchMethodError message is not especially helpful. Here's an example:

$ cat test.dart
main() {
  dynamic c = new Object();
  try { c.x = 1; } catch(e) { print(e); }
}

$ dart -c test.dart 
NoSuchMethodError: Class 'Object' has no instance setter 'x='.
Receiver: Instance of 'Object'
Tried calling: x=1

$ ddc test.dart
NoSuchMethodError : method not found: 'Symbol("x")'
Receiver: Instance of 'Object'
Arguments: [1]
@jmesserly jmesserly added web-dev-compiler P2 A bug or feature request we're likely to work on labels Apr 26, 2017
@lrhn
Copy link
Member

lrhn commented Apr 27, 2017

The spec doesn't actually say which NoSuchMethodError to throw, or which properties it has, so this is purely about consistency, not correctness.

@jmesserly
Copy link
Author

this appears to be fixed:

class C {
  noSuchMethod(i) {
    print(i.memberName);
  }
}
main() {
  dynamic c = new C();
  c.x = 1;
  c.x;
}

prints the correct symbols in DDC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on web-dev-compiler
Projects
None yet
Development

No branches or pull requests

2 participants