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

Type check on generic type is failing #11854

Closed
vsmenon opened this issue Jul 16, 2013 · 11 comments
Closed

Type check on generic type is failing #11854

vsmenon opened this issue Jul 16, 2013 · 11 comments
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@vsmenon
Copy link
Member

vsmenon commented Jul 16, 2013

Note, this is breaking html/js_test in checked mode. I've isolated it to the below. The following code is printing "true" on the VM and "false" in Dart2JS. Interestingly, if I drop "implements Serializable<JsObject>", it prints "true" in Dart2JS, even though that should be immaterial to the type check. It appears that implementing it is confusing the compiler.

  class Serializable<T> {
  }

  // Works with: class JsObject {
  class JsObject implements Serializable<JsObject> {
  }

  class JsFunction extends JsObject implements Serializable<JsFunction> {
  }

  void main() {
    final f = new JsFunction();
    print(f is Serializable<JsFunction>);
  }

@vsmenon
Copy link
Member Author

vsmenon commented Jul 16, 2013

Marked this as blocking #11849.

@peter-ahe-google
Copy link
Contributor

Karl, could you take a look?


cc @johnniwinther.
Set owner to @karlklose.

@karlklose
Copy link
Contributor

Added Accepted label.

@karlklose
Copy link
Contributor

Runtime type checking in dart2sj currently does not support classes that use the same superclass with different type arguments. In this example, Serializable<JsObject> wins over Serializable<JsFunction> because it comes first in the list of supertypes.

@vsmenon
Copy link
Member Author

vsmenon commented Aug 22, 2013

Note, the breaking test (html/js_test) that triggered this report is now passing:

https://codereview.chromium.org/19881003/

I haven't tried the snippet above though.

@kasperl
Copy link

kasperl commented Sep 18, 2013

Added this to the M7 milestone.

@kasperl
Copy link

kasperl commented Sep 30, 2013

Removed Priority-Unassigned label.
Added Priority-Medium 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.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed accepted 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 P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

6 participants