Skip to content

Commit da12e75

Browse files
eejbyfeldtGitHub Copilot
authored andcommitted
Add regression test for 12577.scala (scala#26256)
Seems like this bug got first fixed in 3.4.0 and has worked ever since. Fixes scala#12577 ## How much have you relied on LLM-based tools in this contribution? Not at all ## How was the solution tested? New automated tests (including the issue's reproducer, if applicable) Co-authored-by: GitHub Copilot <copilot@github.com> [Cherry-picked 8c08895]
1 parent 6b6d496 commit da12e75

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/pos/i12577.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import compiletime.constValueOpt
2+
transparent inline def foo[L, R]: Boolean =
3+
inline (constValueOpt[L], constValueOpt[R]) match
4+
case (Some(l), Some(r)) => true
5+
case _ => false
6+
transparent inline def fooWorks[L, R]: Boolean =
7+
inline constValueOpt[L] match
8+
case Some(l) =>
9+
inline constValueOpt[R] match
10+
case Some(l) => true
11+
case _ => false
12+
case _ => false
13+
14+
val f: true = foo[1, 2] //error here
15+
val fWorks: true = fooWorks[1, 2]

0 commit comments

Comments
 (0)