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

AssertionError in TreeGen.mkAttributedQualifier

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.0-1, Scala 2.9.1
    • Fix Version/s: None
    • Component/s: Misc Compiler
    • Labels:
    • Environment:

      Description

      The following code causes the compiler to crash with AssertionError.

      trait OuterClass[V <: OuterClass[V]#InnerClass] {
        trait InnerClass {self: V =>
          def method = ()
        }
      }
      
      trait SubOuterClass[T <: SubOuterClass[T]#SubInnerClass] extends OuterClass[T] {
        class SubInnerClass extends super.InnerClass {self: T =>  }
      }
      
      >scalac Crash.scala
      error: java.lang.AssertionError: assertion failed: jp.seraphr.scala.hello.HelloScala.generics.SubOuterClass[T]
              at scala.tools.nsc.ast.TreeGen.mkAttributedQualifier(TreeGen.scala:66)
              at scala.tools.nsc.ast.TreeGen.mkAttributedQualifier(TreeGen.scala:44)
              at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer.mixinOuterAccessorDef(ExplicitOuter.scala:351)
              at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anonfun$transform$1$$anonfun$apply$mcV$sp$1.apply(ExplicitOuter.scala:457)
              at scala.tools.nsc.transform.ExplicitOuter$ExplicitOuterTransformer$$anonfun$transform$1$$anonfun$apply$mcV$sp$1.apply(ExplicitOuter.scala:455)
              at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      ...
      

        Activity

        Hide
        Paul Phillips added a comment -

        As a workaround, if you declare SubInnerClass's self-type as "self: InnerClass with T => ", it compiles.

        Show
        Paul Phillips added a comment - As a workaround, if you declare SubInnerClass's self-type as "self: InnerClass with T => ", it compiles.
        Hide
        Commit Message Bot added a comment -

        (extempore in r25912) Fix for crasher in explicitouter.

        Closes SI-4970, review by moors.

        Show
        Commit Message Bot added a comment - (extempore in r25912 ) Fix for crasher in explicitouter. Closes SI-4970 , review by moors.

          People

          • Assignee:
            Paul Phillips
            Reporter:
            seraph
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development