Closed
Description
Compiler version
Minimized code
object O
extension [T] (ctx: O.type) inline def unapplySeq(input: T): Option[Seq[T]] = Some(Seq(input))
@main
def Main = {
val O(x) = 3
println(s"x: $x")
}
Output
Compiler error
Exception in thread "main" java.lang.IndexOutOfBoundsException: 0
at scala.collection.LinearSeqOps.apply(LinearSeq.scala:117)
at scala.collection.LinearSeqOps.apply$(LinearSeq.scala:114)
at scala.collection.immutable.List.apply(List.scala:79)
at dotty.tools.dotc.core.Substituters$.substParams(Substituters.scala:151)
at dotty.tools.dotc.core.Substituters$SubstParamsMap.apply(Substituters.scala:197)
at dotty.tools.dotc.core.Substituters$SubstParamsMap.apply(Substituters.scala:197)
at scala.collection.immutable.List.mapConserve(List.scala:472)
at dotty.tools.dotc.core.Types$TypeMap.mapOverLambda(Types.scala:5553)
at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5582)
at dotty.tools.dotc.core.Substituters$.substParams(Substituters.scala:161)
at dotty.tools.dotc.core.Substituters$SubstParamsMap.apply(Substituters.scala:197)
at dotty.tools.dotc.core.Types$TypeMap.mapOverLambda(Types.scala:5555)
at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5582)
at dotty.tools.dotc.core.Substituters$.substParams(Substituters.scala:161)
...
Expectation
x: 3