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 incorrectly generates void check in checked mode #20381

Closed
DartBot opened this issue Aug 6, 2014 · 4 comments
Closed

dart2js incorrectly generates void check in checked mode #20381

DartBot opened this issue Aug 6, 2014 · 4 comments
Assignees

Comments

@DartBot
Copy link

DartBot commented Aug 6, 2014

This issue was originally filed by @simonpai


SDK: 1.5.8

test.dart

library test;
import 'dart:html';
void main() {
  document.body.scrollLeft = 0;
}

Under checked mode this will be compiled to

main: function() {
  var t1 = document.body;
  t1.toString;
  H.voidTypeCheck(t1.scrollLeft = C.JSNumber_methods.toInt$0(C.JSInt_methods.roundToDouble$0(0)));
}

and breaks the app due to the incorrect voidTypeCheck.

@kasperl
Copy link

kasperl commented Aug 6, 2014

cc @karlklose.
Added Area-Dart2JS, Triaged labels.

@karlklose
Copy link
Contributor

Set owner to @karlklose.
Added Accepted label.

@karlklose
Copy link
Contributor

Added Started label.

@karlklose
Copy link
Contributor

Fixed in r38925.

This was not a dart2js issue: the problem was a void typed setter that actually returned a value.

The same happens here (and it is expected to happen):
  void set i(v) => 42;

  void main() {
    i = 42;
  }


Added Fixed label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants