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

AssertionError in TreeGen.mkAttributedQualifier #4970

Closed
scabug opened this issue Sep 5, 2011 · 3 comments
Closed

AssertionError in TreeGen.mkAttributedQualifier #4970

scabug opened this issue Sep 5, 2011 · 3 comments
Assignees

Comments

@scabug
Copy link

scabug commented Sep 5, 2011

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)
...
@scabug
Copy link
Author

scabug commented Sep 5, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4970?orig=1
Reporter: seraph (seraphr)
Affected Versions: 2.9.0-1, 2.9.1

@scabug
Copy link
Author

scabug commented Oct 29, 2011

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

@scabug scabug closed this as completed Oct 29, 2011
@scabug
Copy link
Author

scabug commented Oct 29, 2011

Commit Message Bot (anonymous) said:
(extempore in r25912) Fix for crasher in explicitouter.

Closes #4970, review by moors.

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

No branches or pull requests

2 participants