Closed
Description
Minimization of tests/pos/t6925.scala
class Test:
def f(xs: Set[Int]) = xs collect { case x => x }
def g(xs: Set[Int]): Set[Int] = f(xs)
sbt> set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty
sbt> scala3-bootstrapped/scalac Test.scala -Ycheck:all
checking tests/pos/t6925.scala after phase typer
exception while retyping def g(xs: Set[Int]): Set[Int] = this.f(xs) of class DefDef # -1
An unhandled exception was thrown in the compiler.
Please file a crash report here:
https://github.com/lampepfl/dotty/issues/new/choose
For non-enriched exceptions, compile with -Yno-enrich-error-messages.
while compiling: tests/pos/t6925.scala
during phase: Ycheck
mode: Mode(ImplicitsEnabled)
library version: version 2.13.12
compiler version: version 3.4.1-RC1-bin-SNAPSHOT-git-7bcfce2
settings: -Vprint List(typer) -Ycheck List(all) -classpath /Users/nicolasstucki/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar:/Users/nicolasstucki/Github/dotty/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.4.1-RC1-bin-SNAPSHOT-nonbootstrapped/scala3-library_3-3.4.1-RC1-bin-SNAPSHOT.jar:/Users/nicolasstucki/Github/dotty/scala2-library-cc-tasty/../out/bootstrap/scala2-library-cc-tasty/scala-3.4.1-RC1-bin-SNAPSHOT-nonbootstrapped/scala2-library-cc-tasty_3-3.4.1-RC1-bin-SNAPSHOT.jar -d /
*** error while checking tests/pos/t6925.scala after phase typer ***
Exception in thread "main" java.lang.AssertionError: assertion failed: orphan param: xs.type, hash of binder = 1664998412, tree = <empty>, type = AnnotatedType(AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class collection)),object immutable),trait Set),List(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),class Int))),ConcreteAnnotation(Apply(Select(New(Select(Select(Select(Ident(_root_),scala),annotation),retains)),<init>),List(Typed(SeqLiteral(List(This(Ident()), Ident(pf)),TypeTree[TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),Any)]),TypeTree[AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),<repeated>),List(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),Any)))])))))
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
at dotty.tools.dotc.transform.TreeChecker$$anon$2.apply(TreeChecker.scala:172)
at dotty.tools.dotc.core.Annotations$Annotation$$anon$1.apply(Annotations.scala:64)
...
Originally posted by @nicolasstucki in #19652 (comment)