-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implementation restriction on object nested in value class method #6359
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6359?orig=1 |
@retronym said: |
@hubertp said: |
@retronym said: class M(val t: Int) extends AnyVal {
def lazyString = {
object X
class Y
() => {X; new Y}
}
}
[[symbol layout at end of typer]]
F class M#7016 [+final]
* method lazyString#7392
* class Y#12575
* constructor Y#12578
* value <local Y>#12579
* object X#12574
* constructor X#12576
* value <local X>#12577
* object X#12573
* value $anonfun#12580 (<synthetic>)
class M#7016 (final)
method lazyString#7392
object X#12574
constructor X#12576
value <local X>#12577
object M#7393 (<synthetic>)
object M#7394 (<synthetic>)
constructor M#13922
* method extension$lazyString#13933 (final)
O class Y#12575 [Owner was method lazyString#7392, now method extension$lazyString#13933]
constructor Y#12578
value <local Y>#12579
O object X#12573 [Owner was method lazyString#7392, now method extension$lazyString#13933]
O value $anonfun#12580 [Owner was method lazyString#7392, now method extension$lazyString#13933] (<synthetic>) Here's the naive fix (same as I tried for the lazy vals). https://github.com/retronym/scala/compare/ticket/6359-2 But like last time (https://issues.scala-lang.org/browse/SI-6358?focusedCommentId=60029&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-60029), it might only be skin deep. |
@odersky said: The root cause in both is that the generation of an extension method moves a tree from one context to another. It does this correctly, but if certain things are not in the tree they do not get the changes done and when they resurface in refchecks its too late. Another, slightly less ugly patch would be to treat lazy val acessors and objects specially in the code that creates extension methods. |
@paulp said:
|
@gkossakowski said: |
@paulp said: |
@hubertp said: |
@hubertp said: Timewise, I have some other obligations until 30th, so definitely nothing will happen from my side until then. |
The text was updated successfully, but these errors were encountered: