Skip to content

Inline avrargs crashes typer #5188

Closed
Closed
@nicolasstucki

Description

@nicolasstucki
object Test {
  inline def sum(inline args: Int*): Int = ???
  sum(1, 2, 3)
}

crashes with

Exception in thread "main" java.util.NoSuchElementException: head of empty list
	at scala.collection.immutable.Nil$.head(List.scala:426)
	at scala.collection.immutable.Nil$.head(List.scala:423)
	at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:496)
	at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:288)
	at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:597)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:695)
	at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:755)
	at dotty.tools.dotc.typer.Applications.$anonfun$typedApply$7(Applications.scala:780)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:2058)
	at dotty.tools.dotc.typer.Applications.$anonfun$typedApply$1(Applications.scala:781)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:37)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:725)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:826)
	at dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:723)
	at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:83)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1882)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1936)
	at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1967)
	at dotty.tools.dotc.reporting.trace$.apply(trace.scala:40)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1963)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1979)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2026)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2039)
	at dotty.tools.dotc.typer.Typer.$anonfun$typedClassDef$1(Typer.scala:1593)
	...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions