Skip to content

Commit

Permalink
add test case for scala#14776
Browse files Browse the repository at this point in the history
  • Loading branch information
Linyxus committed Jul 11, 2022
1 parent b7ce563 commit 1e161c7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/pos/gadt-cast-if.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
trait Expr[T]
case class IntExpr() extends Expr[Int]

def flag: Boolean = ???

def foo[T](ev: Expr[T]): Int | T = ev match
case IntExpr() =>
if flag then
val i: T = ???
i
else
(??? : Int)

0 comments on commit 1e161c7

Please sign in to comment.