Scala Programming Language
  1. Scala Programming Language
  2. SI-7045

runtime reflection doesn't autoload thisSym

    Details

      Description

      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
      

        Activity

        Hide
        Eugene Burmako added a comment -

        Probably should a very easy fix. Will try to get it once we're discussing synchronization.

        Show
        Eugene Burmako added a comment - Probably should a very easy fix. Will try to get it once we're discussing synchronization.
        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/pull/2038
        Hide
        Eugene Burmako added a comment -

        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.

        Show
        Eugene Burmako added a comment - 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.
        Hide
        Eugene Burmako added a comment -

        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. https://github.com/scala/scala/pull/2081

        Show
        Eugene Burmako added a comment - 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. https://github.com/scala/scala/pull/2081
        Hide
        James Iry added a comment -

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

        Show
        James Iry added a comment - 2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.
        Hide
        James Iry added a comment -

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

        Show
        James Iry added a comment - 2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.
        Hide
        Jason Zaugg added a comment -

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

        Show
        Jason Zaugg added a comment - Eugene: I believe we can close this now. Please reopen if I've misjudged that.

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Eugene Burmako
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development