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

dart2js executes (broken) code without error #27175

Closed
DanTup opened this issue Aug 27, 2016 · 1 comment
Closed

dart2js executes (broken) code without error #27175

DanTup opened this issue Aug 27, 2016 · 1 comment
Labels
closed-duplicate Closed in favor of an existing report

Comments

@DanTup
Copy link
Collaborator

DanTup commented Aug 27, 2016

This code:

class MyClass {
  String name;
  String doc;

  MyClass(String name, String doc, this.doc);
}

main() {
  var a = new MyClass("test", "test", "test");
  print(a.name);
}

Will error when run in the VM:

```shell
c:\Users\danny\Desktop\DartSample>dart test.dart
'file:///c:/Users/danny/Desktop/DartSample/test.dart': error: line 5 pos 41: duplicate formal parameter 'doc'
  MyClass(String name, String doc, this.doc);

However in dartpad it will just print null without an errors. I believe the behaviour of these should match.

@lrhn
Copy link
Member

lrhn commented Aug 27, 2016

We are in the process of changing the specified behavior.
It used to be the VM which was incorrectly rejecting this program, but we are actually making its behavior correct, and the other implementations are in the process of being made compatible (see #26655).

@lrhn lrhn added the closed-duplicate Closed in favor of an existing report label Aug 27, 2016
@lrhn lrhn closed this as completed Aug 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

2 participants