scala/scala — comment on commit 82c793a438c7bd802daf96c8b2012f54fbd737ba
File:  line 0
By magarciaEPFL:

This commit causes an AssertionError (stacktrace below) when accessing the atp of the `@tailrec` AnnotationInfo for the following local method (in SubstMap, scala.reflect.internal.Types):

@tailrec def subst(tp: Type, sym: Symbol, from: List[Symbol], to: List[T]): Type =
if (from.isEmpty) tp
// else if (to.isEmpty) error("Unexpected substitution on '%s': from = %s but to == Nil".format(tp, from))
else if (matches(from.head, sym)) toType(tp, to.head)
else subst(tp, sym, from.tail, to.tail)

I've tried both with `anninfo matches myclazz` and `myclazz == anninfo.atp.typeSymbol`

error: java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:146)
at scala.reflect.internal.SymbolTable.phase_$eq(SymbolTable.scala:73)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:914)
at scala.reflect.internal.Symbols$Symbol.cookJavaRawInfo(Symbols.scala:1060)
at scala.tools.nsc.typechecker.Infer$Inferencer.checkAccessible(Infer.scala:307)
at scala.tools.nsc.typechecker.Typers$Typer.makeAccessible(Typers.scala:535)
at scala.tools.nsc.typechecker.Typers$Typer.typedSelect$1(Typers.scala:3685)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4251)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4355)
at scala.tools.nsc.typechecker.Typers$Typer.typedAnnotation(Typers.scala:2657)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$18$$anonfun$apply$15.apply(Namers.scala:1223)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$18$$anonfun$apply$15.apply(Namers.scala:1223)
at scala.reflect.internal.AnnotationInfos$LazyAnnotationInfo.liftedTree1$1(AnnotationInfos.scala:133)
at scala.reflect.internal.AnnotationInfos$LazyAnnotationInfo.forcedInfo(AnnotationInfos.scala:132)
at scala.reflect.internal.AnnotationInfos$LazyAnnotationInfo.atp(AnnotationInfos.scala:138)
at scala.reflect.internal.AnnotationInfos$AnnotationInfo.symbol(AnnotationInfos.scala:202)
at scala.reflect.internal.AnnotationInfos$AnnotationInfo.matches(AnnotationInfos.scala:220)
at scala.tools.jdk2ikvm.patchcmds.Generating$AnnIgnorer$$anonfun$collectPatches$4$$anonfun$apply$4.apply(Generating.scala:875)
at scala.tools.jdk2ikvm.patchcmds.Generating$AnnIgnorer$$anonfun$collectPatches$4$$anonfun$apply$4.apply(Generating.scala:875)
at scala.collection.LinearSeqOptimized$class.exists(LinearSeqOptimized.scala:79)
at scala.collection.immutable.List.exists(List.scala:76)
at scala.tools.jdk2ikvm.patchcmds.Generating$AnnIgnorer$$anonfun$collectPatches$4.apply(Generating.scala:875)
at scala.tools.jdk2ikvm.patchcmds.Generating$AnnIgnorer$$anonfun$collectPatches$4.apply(Generating.scala:874)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:749)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:76)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:748)
at scala.tools.jdk2ikvm.patchcmds.Generating$AnnIgnorer.collectPatches(Generating.scala:874)
. . .