Skip to content

Super call to a mixin of an outer class confuses the codegen in 2.12+ #3013

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

Closed
sjrd opened this issue Jun 14, 2017 · 2 comments
Closed

Super call to a mixin of an outer class confuses the codegen in 2.12+ #3013

sjrd opened this issue Jun 14, 2017 · 2 comments
Assignees
Labels
bug Confirmed bug. Needs to be fixed.
Milestone

Comments

@sjrd
Copy link
Member

sjrd commented Jun 14, 2017

Same bug as scala/scala#5944 on the JVM side, for exactly the same reason.

@sjrd sjrd added the bug Confirmed bug. Needs to be fixed. label Jun 14, 2017
@sjrd sjrd added this to the v0.6.18 milestone Jun 14, 2017
@sjrd sjrd self-assigned this Jun 14, 2017
@sjrd
Copy link
Member Author

sjrd commented Jun 14, 2017

The same fix as what was done in the JVM fixes our issue for Scala classes inside Scala classes. But our situation is further complicated by non-native JS classes.

sjrd added a commit to sjrd/scala-js that referenced this issue Jun 14, 2017
Since Scala 2.12, the `qual` part of a super call is not always
`this`. It can be `this.$outer()` or similar things. Therefore, we
cannot blindly assume that the receiver is `this`, nor that the
super call is a JS super call iff the current class is a JS class.

Instead, we correctly use `genExpr(qual)` and inspect
`isRawJSType(qual.tpe)`.
sjrd added a commit to sjrd/scala-js that referenced this issue Jun 14, 2017
Since Scala 2.12, the `qual` part of a super call is not always
`this`. It can be `this.$outer()` or similar things. Therefore, we
cannot blindly assume that the receiver is `this`, nor that the
super call is a JS super call iff the current class is a JS class.

Instead, we correctly use `genExpr(qual)` and inspect
`isRawJSType(qual.tpe)`.
sjrd added a commit that referenced this issue Jun 15, 2017
Fix #3013: Use `genExpr()` for the qualifier of super calls.
@gzm0
Copy link
Contributor

gzm0 commented Jun 16, 2017

Fixed in e02799b

@gzm0 gzm0 closed this as completed Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug. Needs to be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants