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

Free term is not a legal prefix for constructor #7083

Open
scabug opened this issue Feb 5, 2013 · 1 comment
Open

Free term is not a legal prefix for constructor #7083

scabug opened this issue Feb 5, 2013 · 1 comment
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Feb 5, 2013

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

@scabug
Copy link
Author

@scabug scabug commented Feb 5, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7083?orig=1
Reporter: Dmitry Bushev (4e6)
Affected Versions: 2.10.0, 2.10.1-RC1, 2.10.1

@scabug scabug added the macros label Apr 7, 2017
@scabug scabug added this to the Backlog milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants