Skip to content

Inline avrargs crashes typer #5188

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
nicolasstucki opened this issue Oct 1, 2018 · 0 comments
Closed

Inline avrargs crashes typer #5188

nicolasstucki opened this issue Oct 1, 2018 · 0 comments

Comments

@nicolasstucki
Copy link
Contributor

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)
	...
nicolasstucki added a commit that referenced this issue Oct 10, 2018
Fix #5188: See through annotations and typevars when computing argume…
poechsel pushed a commit to poechsel/dotty that referenced this issue Oct 17, 2018
See through annotations (and typevars) when computing argument types.
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

1 participant