Closed
Description
Compiler version
Scala compiler version 3.0.1-RC1-bin-SNAPSHOT-git-c415033 -- Copyright 2002-2021, LAMP/EPFL
Minimized code
I'm in the process of reducing my 300+ line script to a minimal source that reproduces the problem.
In the meantime, maybe someone sees what the problem is from the stack dump. Here's the relevant section showing line 809 of Space.scala
793 private def exhaustivityCheckable(sel: Tree): Boolean = {
794 // Possible to check everything, but be compatible with scalac by default
795 def isCheckable(tp: Type): Boolean =
796 !tp.hasAnnotation(defn.UncheckedAnnot) && {
797 val tpw = tp.widen.dealias
798 val classSym = tpw.classSymbol
799 ctx.settings.YcheckAllPatmat.value ||
800 classSym.is(Sealed) ||
801 tpw.isInstanceOf[OrType] ||
802 (tpw.isInstanceOf[AndType] && {
803 val and = tpw.asInstanceOf[AndType]
804 isCheckable(and.tp1) || isCheckable(and.tp2)
805 }) ||
806 tpw.isRef(defn.BooleanClass) ||
807 classSym.isAllOf(JavaEnumTrait) ||
808 (defn.isProductSubType(tpw) && classSym.is(Case)
809 && productSelectorTypes(tpw, sel.srcPos).exists(isCheckable(_)))
810 }
811
812 val res = isCheckable(sel.tpe)
813 debug.println(s"exhaustivity checkable: ${sel.show} = $res")
814 res
815 }
Output (click arrow to expand)
$ ssrc/showTkacctHist.sc
java.lang.StackOverflowError while compiling C:\opt\ue\ssrc\showTkacctHist.sc
Exception in thread "main" java.lang.StackOverflowError
at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:882)
at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
at dotty.tools.dotc.core.Types$Type.member(Types.scala:650)
at dotty.tools.dotc.typer.Applications$.extractorMember(Applications.scala:47)
at dotty.tools.dotc.typer.Applications$.extractorMemberType(Applications.scala:50)
at dotty.tools.dotc.typer.Applications$.$anonfun$2(Applications.scala:116)
at dotty.tools.dotc.typer.Applications$.$anonfun$adapted$1(Applications.scala:116)
at scala.collection.Iterator$$anon$9.next(Iterator.scala:575)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:628)
at scala.collection.immutable.List.prependedAll(List.scala:152)
at scala.collection.IterableOnceOps.toList(IterableOnce.scala:1251)
at scala.collection.IterableOnceOps.toList$(IterableOnce.scala:1251)
at scala.collection.AbstractIterator.toList(Iterator.scala:1288)
at dotty.tools.dotc.typer.Applications$.productSelectorTypes(Applications.scala:117)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$1(Space.scala:809)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$2$$anonfun$1(Space.scala:809)
at scala.collection.immutable.List.exists(List.scala:395)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$1(Space.scala:809)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$2$$anonfun$1(Space.scala:809)
at scala.collection.immutable.List.exists(List.scala:395)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$1(Space.scala:809)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$2$$anonfun$1(Space.scala:809)
at scala.collection.immutable.List.exists(List.scala:395)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$1(Space.scala:809)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$2$$anonfun$1(Space.scala:809)
at scala.collection.immutable.List.exists(List.scala:395)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$1(Space.scala:809)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$2$$anonfun$1(Space.scala:809)
at scala.collection.immutable.List.exists(List.scala:395)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$1(Space.scala:809)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$2$$anonfun$1(Space.scala:809)
at scala.collection.immutable.List.exists(List.scala:395)
at dotty.tools.dotc.transform.patmat.SpaceEngine.isCheckable$1(Space.scala:809)
<snip>