Skip to content

ICE: java.util.NoSuchElementException: head of empty list, at dotty.tools.dotc.core.SymDenotations$SymDenotation.recurWithParamss$1(SymDenotations.scala:312) #12455

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

Closed
chengniansun opened this issue May 13, 2021 · 1 comment

Comments

@chengniansun
Copy link

Compiler Version

Scala compiler version 3.0.1-RC1-bin-SNAPSHOT-git-4410752 -- Copyright 2002-2021, LAMP/EPFL

System Information

Linux 5.4.0-66-generic x86_64 GNU/Linux

Minimized Code

class A { util.Random shuffle }

Output (click arrow to expand)

-- Error: mutant.scala:1:15 -----------------------------------------------------------------------------------------------------------------
1 |class A { util.Random shuffle }
  |          ^^^^^^^^^^^
  |          postfix operator `shuffle` needs to be enabled
  |          by making the implicit value scala.language.postfixOps visible.
  |          ----
  |          This can be achieved by adding the import clause 'import scala.language.postfixOps'
  |          or by setting the compiler option -language:postfixOps.
  |          See the Scaladoc for value scala.language.postfixOps for a discussion
  |          why the feature needs to be explicitly enabled.
exception occurred while typechecking mutant.scala
exception occurred while compiling mutant.scala
java.util.NoSuchElementException: head of empty list while compiling mutant.scala
Exception in thread "main" java.util.NoSuchElementException: head of empty list
	at scala.collection.immutable.Nil$.head(List.scala:629)
	at scala.collection.immutable.Nil$.head(List.scala:628)
	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.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:3332)
	at dotty.tools.dotc.typer.Typer.issueErrors$1$$anonfun$1$$anonfun$1(Typer.scala:3344)
	at dotty.tools.dotc.reporting.NoExplanation.msg(Message.scala:133)
	at dotty.tools.dotc.reporting.Message.message(Message.scala:88)
	at dotty.tools.dotc.reporting.Message.isNonSensical(Message.scala:100)
	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:3346)
	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:3348)
	at dotty.tools.dotc.typer.Typer.addImplicitArgs$3(Typer.scala:3374)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsImplicitMethod$2(Typer.scala:3391)
	at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:3588)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3801)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1392)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1379)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1392)
	at dotty.tools.dotc.typer.Namer.typedAheadRhs$1$$anonfun$1(Namer.scala:1544)
	at dotty.tools.dotc.typer.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:225)
	at dotty.tools.dotc.typer.Namer.typedAheadRhs$2(Namer.scala:1544)
	at dotty.tools.dotc.typer.Namer.rhsType$1(Namer.scala:1552)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1579)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1580)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1591)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1600)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1683)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:703)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:826)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:727)
	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:2627)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2652)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2747)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2839)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2889)
	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1020)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1024)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2693)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2748)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.typedFunctionValue(Typer.scala:1382)
	at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:1147)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2695)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2748)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsUnappliedMethod$2(Typer.scala:3445)
	at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:3608)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3801)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3153)
	at dotty.tools.dotc.typer.Typer.readapt$1(Typer.scala:3164)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3788)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2866)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2889)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2344)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2673)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2677)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2747)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2839)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2889)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2467)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2718)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2748)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2933)
	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)
@som-snytt
Copy link
Contributor

Fixed per linked issue.

@smarter smarter closed this as completed Oct 15, 2021
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

4 participants