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

Free term is not a legal prefix for constructor

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.10.0, Scala 2.10.1-RC1, Scala 2.10.1
    • Fix Version/s: None
    • Component/s: Macros
    • Labels:
      None

      Description

      import scala.reflect.runtime.universe._
      import scala.tools.reflect.ToolBox
      import scala.tools.reflect.Eval
      
      class O { class I }
      
      class A extends O {
        val code = reify {
          val v: I = new I
          v
        }
        println(showRaw(code))
      }
      
      object Test extends App {
        val v: A#I = (new A).code.eval
      }
      

      Class A is reified as free term A$value, and reflective compilation fails on typecheck of the expression new A$value.I() with the following error:

      issue error: Test.this.A is not a legal prefix for a constructor

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Dmitry Bushev
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development