Skip to content

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

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
retronym opened this issue May 29, 2015 · 1 comment

Comments

@retronym
Copy link
Member

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

@felixmulder
Copy link
Contributor

This no longer crashes dotc and gives a similar error message when compiling compared with scalac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants