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 doesn't match void and dynamic return types when checking function types. #13407

Closed
floitschG opened this issue Sep 18, 2013 · 5 comments
Labels
closed-obsolete Closed as the reported issue is no longer relevant P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@floitschG
Copy link
Contributor

dart2js doesn't match void and dynamic return types when checking function types. At least not, when dynamic is a generic type variable.
This is only happening in checked mode.

Example:

$ cat /tmp/bug.dart
class A<T> {
  foo(T bar()) => bar();
}

main() {
  void bar() {};
  new A().foo(bar);
}

$ sdk/bin/dart2js --out=t/foo.js /tmp/bug.dart --checked

$ v8 t/foo.js
t/foo.js:587: type 'main_bar' is not a subtype of type 'T_'
    throw H.wrapException(H.TypeErrorImplementation$(object, signatureName));
            ^
type 'main_bar' is not a subtype of type 'T_'
    at wrapException (t/foo.js:332:13)
    at assertFunctionSubtype (t/foo.js:587:13)
    at main (t/foo.js:874:5)
    at t/foo.js:1226:7
    at init.currentScript (t/foo.js:1202:5)
    at t/foo.js:1220:3
    at t/foo.js:1428:3

@kasperl
Copy link

kasperl commented Sep 18, 2013

Added this to the M7 milestone.
Removed Priority-Unassigned label.
Added Priority-Low label.

@kasperl
Copy link

kasperl commented Oct 2, 2013

Removed this from the M7 milestone.
Added this to the M8 milestone.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the M8 milestone.
Added this to the 1.6 milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@floitschG floitschG added Type-Defect P3 A lower priority bug or feature request web-dart2js labels Aug 4, 2014
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Feb 29, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants