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
Comments
Marked this as blocking #11849. |
Karl, could you take a look? cc @johnniwinther. |
Added Accepted label. |
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. |
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. |
Added this to the M7 milestone. |
Removed Priority-Unassigned label. |
Removed this from the 1.6 milestone. |
Removed Oldschool-Milestone-1.6 label. |
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>);
}
The text was updated successfully, but these errors were encountered: