Skip to content

crasher with unusual combination of repeated params, param forwarding, and nothing #618

Closed
@retronym

Description

@retronym
class C(val f: Any*)

class D(override val f: Nothing) extends C(f)
./bin/dotc sandbox/test.scala
exception while transforming (f: Nothing) extends C(Predef.genericWrapArray([f()])) {
  override <accessor> def f(): Nothing
  def f(): scala.collection.Seq = this.f()
} of class class dotty.tools.dotc.ast.Trees$Template # 897
exception while transforming class D(f: Nothing) extends C(Predef.genericWrapArray([f()])) {
  override <accessor> def f(): Nothing
  def f(): scala.collection.Seq = this.f()
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 898
exception while transforming package <empty> {
  class C(f: scala.collection.Seq) extends Object() {
    <accessor> def f(): scala.collection.Seq
  }
  final lazy module val C: C$ = new C$()
  final module class C$() extends Object() { this: C$ =>}
  class D(f: Nothing) extends C(Predef.genericWrapArray([f()])) {
    override <accessor> def f(): Nothing
    def f(): scala.collection.Seq = this.f()
  }
  final lazy module val D: D$ = new D$()
  final module class D$() extends Object() { this: D$ =>}
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 915
exception occurred while compiling sandbox/test.scala
Exception in thread "main" java.util.NoSuchElementException: head of empty list
    at scala.collection.immutable.Nil$.head(List.scala:420)

Followup from #617, /cc @smarter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions