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

runtime reflection doesn't autoload thisSym #7045

Closed
scabug opened this issue Jan 30, 2013 · 8 comments
Closed

runtime reflection doesn't autoload thisSym #7045

scabug opened this issue Jan 30, 2013 · 8 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jan 30, 2013

Unlike, say, annotations or flags, thisSym doesn't get auto-populated and requires a symbol to be pre-initialized to work correctly.

import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}

class C
class D { self: C => }

object Test extends App {
  val d = cm.staticClass("D")
  println(d.selfType)
  d.typeSignature
  println(d.selfType)
}
19:33 ~/Projects/Kepler_6240/sandbox (ticket/6240)$ scalac Test.scala && scala Test
D
D with C
@scabug
Copy link
Author

scabug commented Jan 30, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7045?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.0

@scabug
Copy link
Author

scabug commented Jan 31, 2013

@xeno-by said:
Probably should a very easy fix. Will try to get it once we're discussing synchronization.

@scabug
Copy link
Author

scabug commented Jan 31, 2013

@xeno-by said:
scala/scala#2038

@scabug
Copy link
Author

scabug commented Feb 4, 2013

@xeno-by said:
Don't have time for this in 2.10.1. It looks like importers or runtime compilation (or both) have some weird bug related to unpickling.

@scabug
Copy link
Author

scabug commented Feb 7, 2013

@xeno-by said:
Haha! The fix was trivial! We have the dedicated Symbol.selfType method, called only by runtime reflection, therefore we don't need to jump through hoops and auto-initialize thisSym, which is also used in the compile. scala/scala#2081

@scabug
Copy link
Author

scabug commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

1 similar comment
@scabug
Copy link
Author

scabug commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

@scabug
Copy link
Author

scabug commented Nov 21, 2013

@retronym said:
Eugene: I believe we can close this now. Please reopen if I've misjudged that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants