Skip to content

Fail to type generic tuple pattern match #5271

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 17, 2018 · 1 comment
Closed

Fail to type generic tuple pattern match #5271

nicolasstucki opened this issue Oct 17, 2018 · 1 comment

Comments

@nicolasstucki
Copy link
Contributor

tests/pending/tuple-patmat-extract.scala crashes the compiler.

It can be minimized to

val (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) =
  (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, List(2, 1), 22, 23)

which fail with

Exception in thread "main" dotty.tools.dotc.ast.Trees$UnAssignedTypeException: type of Apply(Ident(List),List(Literal(Constant(2)), Literal(Constant(1)))) is not assigned
	at dotty.tools.dotc.ast.Trees$Tree.tpe(Trees.scala:93)
	at dotty.tools.dotc.typer.Typer.$anonfun$typedTuple$5(Typer.scala:1818)
	at scala.runtime.Tuple2Zipped$.$anonfun$map$1(Tuple2Zipped.scala:47)
	at scala.collection.immutable.List.foreach(List.scala:388)
	at scala.runtime.Tuple2Zipped$.map$extension(Tuple2Zipped.scala:45)
	at dotty.tools.dotc.typer.Typer.typedTuple(Typer.scala:1817)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1913)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1931)
	at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1962)
	at dotty.tools.dotc.reporting.trace$.apply(trace.scala:40)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1958)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1974)
	at dotty.tools.dotc.typer.Typer.$anonfun$typedAnnotated$1(Typer.scala:1712)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:37)
	at dotty.tools.dotc.typer.Typer.typedAnnotated(Typer.scala:1710)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1910)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1931)
	at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1962)
	at dotty.tools.dotc.reporting.trace$.apply(trace.scala:40)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1958)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1974)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2037)
	at dotty.tools.dotc.typer.Typer.$anonfun$typedMatch$1(Typer.scala:973)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:37)
	at dotty.tools.dotc.typer.Typer.typedMatch(Typer.scala:967)
	...
@nicolasstucki
Copy link
Contributor Author

Actually fails with(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, List(2, 1), 22, 23)

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Oct 24, 2018
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Oct 24, 2018
nicolasstucki added a commit that referenced this issue Oct 25, 2018
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