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

Case class within value class causes no-symbol error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0-M3, Scala 2.10.0
    • Fix Version/s: Scala 2.10.0-M6
    • Component/s: Misc Compiler
    • Environment:

      Tested with 2.10.0-M3 and 2.10.0-20120604-062714-e90ea27cbe

      Description

      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>
      

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Martin Odersky
              Reporter:
              Stefan Zeiger
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development