bug icon indicating copy to clipboard operation
bug copied to clipboard

Compiler crasher with named-args + implicit

Open retronym opened this issue 3 years ago • 1 comments

Reproduction steps

Scala version: 2.12.17, 2.13.8

scala> class C(a: Int, b: Int)(c: Int)(implicit d: DummyImplicit)
defined class C

scala> def i = 1; class D extends C(b = i, a = i)(error)
                                                  ^
       error: not found: value error
java.lang.NullPointerException
	at scala.tools.nsc.typechecker.Typers$Typer.analyzeSuperConsructor(Typers.scala:2212)
	at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2398)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5950)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6041)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:6119)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3410)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3410)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2064)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1895)
java.lang.NullPointerException
	at scala.tools.nsc.typechecker.Typers$Typer.analyzeSuperConsructor(Typers.scala:2149)
	at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2333)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5701)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5781)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5845)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3337)

Problem

Should not crash.

retronym avatar Sep 22 '22 03:09 retronym

We need a new prize. Instead of "shortest crasher", it would be "fewest interacting features resulting in crasher." 🏆

This would take the prize for "most interacting features, all of which are required for crasher."

som-snytt avatar Sep 22 '22 04:09 som-snytt