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

Case class within value class causes no-symbol error #5882

Closed
scabug opened this issue Jun 5, 2012 · 1 comment
Closed

Case class within value class causes no-symbol error #5882

scabug opened this issue Jun 5, 2012 · 1 comment
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jun 5, 2012

Compiling this code

class NodeOps(val n: Any) extends AnyVal {
  case class Scope
}

leads to

C:\Users\szeiger\Desktop\stest>c:\StandaloneApps\scala-2.10.0-20120604-062714-e90ea27cbe\bin\scalac Scope.scala
error: no-symbol does not have an owner

     while compiling: Scope.scala
        during phase: erasure
     library version: version 2.10.0-20120604-062714-e90ea27cbe
    compiler version: version 2.10.0-20120604-062714-e90ea27cbe
  reconstructed args:

  last tree to typer: This(object Scope)
              symbol: object Scope in class NodeOps (flags: <module> <synthetic>)
   symbol definition: class Scope extends AbstractFunction0[NodeOps.this.Scope] with Serializable
                 tpe: NodeOps.Scope.type
       symbol owners: object Scope -> class NodeOps -> package <empty>
      context owners: method readResolve -> object Scope -> class NodeOps -> package <empty>

== Enclosing template or block ==

DefDef( // private def readResolve(): Object in object Scope
  private <method> <synthetic>
  "readResolve"
  []
  List(Nil)
  <tpt> // tree.tpe=Object
  Apply( // object Scope in class NodeOps, tree.tpe=NodeOps.this.Scope.type
    Scope.this."$outer "."Scope" // object Scope in class NodeOps, tree.tpe=()NodeOps.this.Scope.type
    Nil
  )
)

== Expanded type of tree ==

ThisType(object Scope)

unhandled exception while transforming Scope.scala
error:
     while compiling: Scope.scala
        during phase: erasure
     library version: version 2.10.0-20120604-062714-e90ea27cbe
    compiler version: version 2.10.0-20120604-062714-e90ea27cbe
  reconstructed args:

  last tree to typer: This(object Scope)
              symbol: object Scope in class NodeOps (flags: <module> <synthetic>)
   symbol definition: class Scope extends AbstractFunction0[NodeOps.this.Scope] with Serializable
                 tpe: NodeOps.Scope.type
       symbol owners: object Scope -> class NodeOps -> package <empty>
      context owners: method readResolve -> object Scope -> class NodeOps -> package <empty>

== Enclosing template or block ==

DefDef( // private def readResolve(): Object in object Scope
  private <method> <synthetic>
  "readResolve"
  []
  List(Nil)
  <tpt> // tree.tpe=Object
  Apply( // object Scope in class NodeOps, tree.tpe=NodeOps.this.Scope.type
    Scope.this."$outer "."Scope" // object Scope in class NodeOps, tree.tpe=()NodeOps.this.Scope.type
    Nil
  )
)

== Expanded type of tree ==

ThisType(object Scope)

uncaught exception during compilation: scala.reflect.internal.FatalError
error: scala.reflect.internal.FatalError:
     while compiling: Scope.scala
        during phase: erasure
     library version: version 2.10.0-20120604-062714-e90ea27cbe
    compiler version: version 2.10.0-20120604-062714-e90ea27cbe
  reconstructed args:

  last tree to typer: This(object Scope)
              symbol: object Scope in class NodeOps (flags: <module> <synthetic>)
   symbol definition: class Scope extends AbstractFunction0[NodeOps.this.Scope] with Serializable
                 tpe: NodeOps.Scope.type
       symbol owners: object Scope -> class NodeOps -> package <empty>
      context owners: method readResolve -> object Scope -> class NodeOps -> package <empty>

== Enclosing template or block ==

DefDef( // private def readResolve(): Object in object Scope
  private <method> <synthetic>
  "readResolve"
  []
  List(Nil)
  <tpt> // tree.tpe=Object
  Apply( // object Scope in class NodeOps, tree.tpe=NodeOps.this.Scope.type
    Scope.this."$outer "."Scope" // object Scope in class NodeOps, tree.tpe=()NodeOps.this.Scope.type
    Nil
  )
)

== Expanded type of tree ==

ThisType(object Scope)

no-symbol does not have an owner
        at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:43)
        at scala.tools.nsc.Global.abort(Global.scala:229)
        at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3109)
        at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:130)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preErase(Erasure.scala:1033)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1088)
        at scala.reflect.api.Trees$Transformer$$anonfun$transform$5.apply(Trees.scala:1461)
        at scala.reflect.api.Trees$Transformer$$anonfun$transform$5.apply(Trees.scala:1459)
        at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1574)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
        at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1458)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1096)
        at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$2.apply(Trees.scala:1567)
        at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$2.apply(Trees.scala:1565)
        at scala.collection.immutable.List.loop$1(List.scala:163)
        at scala.collection.immutable.List.mapConserve(List.scala:179)
        at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1565)
        at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1473)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.scala$tools$nsc$transform$TypingTransformers$TypingTransformer$$super$transform(TypingTransformers.scala:49)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
        at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1574)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:49)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1100)
        at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1551)
        at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1445)
        at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1444)
        at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1574)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
        at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1443)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1100)
        at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$2.apply(Trees.scala:1567)
        at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$2.apply(Trees.scala:1565)
        at scala.collection.immutable.List.loop$1(List.scala:163)
        at scala.collection.immutable.List.mapConserve(List.scala:179)
        at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1565)
        at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1473)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.scala$tools$nsc$transform$TypingTransformers$TypingTransformer$$super$transform(TypingTransformers.scala:49)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
        at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1574)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:49)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1100)
        at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1551)
        at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1445)
        at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1444)
        at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1574)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
        at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1443)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1100)
        at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$2.apply(Trees.scala:1567)
        at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$2.apply(Trees.scala:1565)
        at scala.collection.immutable.List.loop$1(List.scala:163)
        at scala.collection.immutable.List.mapConserve(List.scala:179)
        at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1565)
        at scala.reflect.api.Trees$Transformer$$anonfun$transform$1.apply(Trees.scala:1439)
        at scala.reflect.api.Trees$Transformer$$anonfun$transform$1.apply(Trees.scala:1439)
        at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1574)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
        at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1438)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.scala$tools$nsc$transform$TypingTransformers$TypingTransformer$$super$transform(TypingTransformers.scala:49)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$2.apply(TypingTransformers.scala:51)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$2.apply(TypingTransformers.scala:51)
        at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1574)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
        at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:51)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1100)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer.transform(Erasure.scala:1110)
        at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:226)
        at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:435)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:402)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:402)
        at scala.collection.Iterator$class.foreach(Iterator.scala:724)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1152)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:402)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1541)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1520)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1514)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1621)
        at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
        at scala.tools.nsc.Main$.doCompile(Main.scala:81)
        at scala.tools.nsc.Driver.process(Driver.scala:52)
        at scala.tools.nsc.Driver.main(Driver.scala:65)
        at scala.tools.nsc.Main.main(Main.scala)

error: fatal error:
     while compiling: Scope.scala
        during phase: erasure
     library version: version 2.10.0-20120604-062714-e90ea27cbe
    compiler version: version 2.10.0-20120604-062714-e90ea27cbe
  reconstructed args:

  last tree to typer: This(object Scope)
              symbol: object Scope in class NodeOps (flags: <module> <synthetic>)
   symbol definition: class Scope extends AbstractFunction0[NodeOps.this.Scope] with Serializable
                 tpe: NodeOps.Scope.type
       symbol owners: object Scope -> class NodeOps -> package <empty>
      context owners: method readResolve -> object Scope -> class NodeOps -> package <empty>

== Enclosing template or block ==

DefDef( // private def readResolve(): Object in object Scope
  private <method> <synthetic>
  "readResolve"
  []
  List(Nil)
  <tpt> // tree.tpe=Object
  Apply( // object Scope in class NodeOps, tree.tpe=NodeOps.this.Scope.type
    Scope.this."$outer "."Scope" // object Scope in class NodeOps, tree.tpe=()NodeOps.this.Scope.type
    Nil
  )
)

== Expanded type of tree ==

ThisType(object Scope)

no-symbol does not have an owner

C:\Users\szeiger\Desktop\stest>
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 5, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5882?orig=1
Reporter: @szeiger
Affected Versions: 2.10.0-M3, 2.10.0

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.