Skip to content
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

Typer crash on small tuples #5640

Closed
b-studios opened this issue Dec 18, 2018 · 0 comments
Closed

Typer crash on small tuples #5640

b-studios opened this issue Dec 18, 2018 · 0 comments

Comments

@b-studios
Copy link
Contributor

Typer crashes with a NullpointerException when type checking the following example:

object test {
  val foo = (()) => ()
}

For easier reference, here is part of the stacktrace:

Exception in thread "main" java.lang.NullPointerException
	at dotty.tools.dotc.ast.tpd$.ref(tpd.scala:369)
	at dotty.tools.dotc.ast.untpd$.ref(untpd.scala:353)
	at dotty.tools.dotc.ast.desugar$.smallTuple(Desugar.scala:923)
	at dotty.tools.dotc.typer.Typer.typedTuple(Typer.scala:1848)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1961)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1979)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2010)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2022)
	at dotty.tools.dotc.typer.Namer.typedAheadType$$anonfun$1(Namer.scala:993)
	at dotty.tools.dotc.typer.Namer.typedAheadImpl(Namer.scala:986)
	at dotty.tools.dotc.typer.Namer.typedAheadType(Namer.scala:993)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1177)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:712)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:796)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:741)
        ...
@odersky odersky closed this as completed in 871a87e Jan 4, 2019
odersky added a commit that referenced this issue Jan 4, 2019
Fixes #5640 Typer crash on 0 arity tuple
nicolasstucki pushed a commit to dotty-staging/dotty that referenced this issue Jan 5, 2019
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

2 participants