Closed GavinRay97 closed 2 years ago
Minimized to:
foo.scala
// Compile with Scala 2.13
trait Bar
class Foo {
def foo(out: Foo)(implicit bar: Bar): out.type = out
}
boom.scala
// no implicit of type Bar in scope
def boom(foo: Foo) = foo.foo(foo)
$ scalac -version && dotc -version
Scala compiler version 2.13.6 -- Copyright 2002-2021, LAMP/EPFL and Lightbend, Inc.
Scala compiler version 3.0.3-RC1-bin-SNAPSHOT-git-814fca6 -- Copyright 2002-2021, LAMP/EPFL
$ scalac foo.scala
$ dotc boom.scala
exception occurred while typechecking boom.scala
exception occurred while compiling boom.scala
java.util.NoSuchElementException: head of empty list while compiling boom.scala
Exception in thread "main" java.util.NoSuchElementException: head of empty list
at scala.collection.immutable.Nil$.head(List.scala:662)
at scala.collection.immutable.Nil$.head(List.scala:661)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.recurWithParamss$1(SymDenotations.scala:312)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.recurWithParamss$1(SymDenotations.scala:312)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.paramSymss(SymDenotations.scala:329)
at dotty.tools.dotc.typer.Typer.paramSymWithMethodTree$3(Typer.scala:3344)
at dotty.tools.dotc.typer.Typer.issueErrors$1$$anonfun$1$$anonfun$1(Typer.scala:3356)
at dotty.tools.dotc.reporting.NoExplanation.msg(Message.scala:132)
at dotty.tools.dotc.reporting.Message.message(Message.scala:87)
at dotty.tools.dotc.reporting.Message.isNonSensical(Message.scala:99)
at dotty.tools.dotc.reporting.HideNonSensicalMessages.isHidden(HideNonSensicalMessages.scala:16)
at dotty.tools.dotc.reporting.HideNonSensicalMessages.isHidden$(HideNonSensicalMessages.scala:10)
at dotty.tools.dotc.reporting.AbstractReporter.isHidden(AbstractReporter.scala:8)
at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:148)
at dotty.tools.dotc.report$.error(report.scala:71)
at dotty.tools.dotc.typer.Typer.issueErrors$2$$anonfun$2(Typer.scala:3358)
at scala.runtime.function.JProcedure3.apply(JProcedure3.java:15)
at scala.runtime.function.JProcedure3.apply(JProcedure3.java:10)
at scala.collection.LazyZip3.foreach(LazyZipOps.scala:248)
at dotty.tools.dotc.typer.Typer.issueErrors$3(Typer.scala:3360)
at dotty.tools.dotc.typer.Typer.addImplicitArgs$3(Typer.scala:3386)
at dotty.tools.dotc.typer.Typer.adaptNoArgsImplicitMethod$2(Typer.scala:3403)
at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:3600)
at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3813)
at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3165)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2824)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2828)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2944)
at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1424)
at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1414)
at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1424)
at dotty.tools.dotc.typer.Namer.typedAheadRhs$1$$anonfun$1(Namer.scala:1676)
at dotty.tools.dotc.typer.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:225)
at dotty.tools.dotc.typer.Namer.typedAheadRhs$2(Namer.scala:1676)
at dotty.tools.dotc.typer.Namer.rhsType$1(Namer.scala:1684)
at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1711)
at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1712)
at dotty.tools.dotc.typer.Namer.inferredResultType(Namer.scala:1723)
at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1463)
at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1470)
at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1554)
at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:755)
at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:887)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:779)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:369)
at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2638)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2663)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2758)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2824)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2828)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2850)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2900)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2355)
at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2684)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2688)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2758)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2824)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2828)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2850)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2900)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2478)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2729)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2759)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2824)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2828)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2944)
at dotty.tools.dotc.typer.FrontEnd.liftedTree1$1(FrontEnd.scala:79)
at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:84)
at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:43)
at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:85)
at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:120)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:120)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:205)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.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:216)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:224)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
at dotty.tools.dotc.Run.compileUnits(Run.scala:231)
at dotty.tools.dotc.Run.compileSources(Run.scala:166)
at dotty.tools.dotc.Run.compile(Run.scala:150)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
at dotty.tools.dotc.Driver.process(Driver.scala:199)
at dotty.tools.dotc.Driver.process(Driver.scala:167)
at dotty.tools.dotc.Driver.process(Driver.scala:179)
at dotty.tools.dotc.Driver.main(Driver.scala:209)
at dotty.tools.dotc.Main.main(Main.scala)
Compiler version
3.0.0
Minimized code
https://scastie.scala-lang.org/L6jYE1KFSYqlUA5S8UPfwg
It's the
file.unzipTo
line -- that code is here if it matters:unzipTo
nameWithoutExtension
Output (click arrow to expand)