You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed some strange logic in the handling of unapply return types, so I poked in the REPL a bit and it blew up:
Minimized code
scala>caseclassA(a: Int)
// defined case class A
scala>objectC { defunapply(a: A):true|true=true }
// defined object C
scala> (A(1):A|A) match { caseC() =>"OK" }
Exception in thread "main" java.lang.AssertionError: assertion failed
Output (click arrow to expand)
Exception in thread "main" java.lang.AssertionError: assertion failed
at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
at dotty.tools.dotc.transform.PatternMatcher$Translator.unapplyPlan$3$$anonfun$2(PatternMatcher.scala:340)
at dotty.tools.dotc.transform.PatternMatcher$Translator.letAbstract(PatternMatcher.scala:106)
at dotty.tools.dotc.transform.PatternMatcher$Translator.unapplyPlan$1(PatternMatcher.scala:358)
at dotty.tools.dotc.transform.PatternMatcher$Translator.patternPlan(PatternMatcher.scala:384)
at dotty.tools.dotc.transform.PatternMatcher$Translator.caseDefPlan(PatternMatcher.scala:420)
at dotty.tools.dotc.transform.PatternMatcher$Translator.matchPlan$$anonfun$2$$anonfun$1(PatternMatcher.scala:427)
at scala.collection.immutable.List.foldRight(List.scala:324)
at dotty.tools.dotc.transform.PatternMatcher$Translator.matchPlan$$anonfun$1(PatternMatcher.scala:427)
at dotty.tools.dotc.transform.PatternMatcher$Translator.letAbstract(PatternMatcher.scala:106)
at dotty.tools.dotc.transform.PatternMatcher$Translator.matchPlan(PatternMatcher.scala:428)
at dotty.tools.dotc.transform.PatternMatcher$Translator.translateMatch(PatternMatcher.scala:980)
at dotty.tools.dotc.transform.PatternMatcher.transformMatch(PatternMatcher.scala:41)
at dotty.tools.dotc.transform.MegaPhase.goMatch(MegaPhase.scala:746)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:345)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
at dotty.tools.dotc.transform.MegaPhase.mapValDef$1(MegaPhase.scala:234)
at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:238)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:394)
at dotty.tools.dotc.transform.MegaPhase.transformStat$2(MegaPhase.scala:404)
at dotty.tools.dotc.transform.MegaPhase.$anonfun$1(MegaPhase.scala:409)
at scala.collection.immutable.List.mapConserve(List.scala:444)
at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:409)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:339)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:251)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:394)
at dotty.tools.dotc.transform.MegaPhase.transformStat$2(MegaPhase.scala:404)
at dotty.tools.dotc.transform.MegaPhase.$anonfun$1(MegaPhase.scala:409)
at scala.collection.immutable.List.mapConserve(List.scala:444)
at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:409)
at dotty.tools.dotc.transform.MegaPhase.mapPackage$1(MegaPhase.scala:356)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
at dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:415)
at dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:427)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:318)
at scala.collection.immutable.List.map(List.scala:219)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:319)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:165)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
at dotty.tools.dotc.Run.runPhases$5(Run.scala:175)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:183)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:64)
at dotty.tools.dotc.Run.compileUnits(Run.scala:190)
at dotty.tools.dotc.Run.compileUnits(Run.scala:132)
at dotty.tools.repl.ReplCompiler.runCompilationUnit(ReplCompiler.scala:156)
at dotty.tools.repl.ReplCompiler.compile(ReplCompiler.scala:166)
at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:229)
at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:193)
at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:127)
at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:130)
at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:148)
at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:130)
at dotty.tools.repl.Main$.main(Main.scala:6)
at dotty.tools.repl.Main.main(Main.scala)
The text was updated successfully, but these errors were encountered:
I noticed some strange logic in the handling of unapply return types, so I poked in the REPL a bit and it blew up:
Minimized code
Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: