Skip to content

Commit 61591f7

Browse files
authored
Add regression test for #23952 (#26546)
Closes #23952 The issue was fixed by #26063. Adds a regression test. ## Have you relied on LLM-based tools in this contribution? No ## How was the solution tested? New automated tests (including the issue's reproducer, if applicable)
1 parent 5f24bf2 commit 61591f7

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tests/pos/i23952.scala

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
trait Typeclass[I]
2+
3+
sealed trait Enumm:
4+
type Insider
5+
6+
object Enumm:
7+
case object Enumm1 extends Enumm:
8+
case class Insider()
9+
10+
object Insider:
11+
given t: Typeclass[Insider] = new Typeclass[Insider] {}
12+
13+
class Foo
14+
implicit val f: Foo = new Foo
15+
16+
def pathDependentTypeDefaultParam(tpe: Enumm)(i: tpe.Insider, p: Int = 0)(using t: Typeclass[tpe.Insider]): Int = p
17+
def defaultParamNotPDT(tpe: Enumm)(i: tpe.Insider, p: Int = 0)(using t: Foo): Int = p
18+
def pathDependentTypeDefaultParamOwnList(tpe: Enumm)(i: tpe.Insider)(p: Int = 0)(using t: Typeclass[tpe.Insider]): Int = p
19+
20+
def main =
21+
pathDependentTypeDefaultParam(Enumm.Enumm1)(Enumm.Enumm1.Insider())
22+
pathDependentTypeDefaultParam(Enumm.Enumm1)(Enumm.Enumm1.Insider(), p = 0)
23+
defaultParamNotPDT(Enumm.Enumm1)(Enumm.Enumm1.Insider())
24+
pathDependentTypeDefaultParamOwnList(Enumm.Enumm1)(Enumm.Enumm1.Insider())()
25+
pathDependentTypeDefaultParamOwnList(Enumm.Enumm1)(Enumm.Enumm1.Insider())(p = 0)

0 commit comments

Comments
 (0)