Skip to content

Commit

Permalink
Test term ref scrutinees aren't generally widened
Browse files Browse the repository at this point in the history
Co-Authored-By: Matt Bovel <matthieu@bovel.net>
  • Loading branch information
dwijnand and mbovel committed Jun 23, 2023
1 parent 97dcf78 commit fcc753b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/neg/mt-scrutinee-widen.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// We widen scrutinee's that are inline proxies
// But make sure that term refs in scrutinees are not widened in general

val x: Int = 42
val y: Int = 43
val z: Int = 44

type IsX[T] =
T match
case x.type => true
case _ => false
def test = summon[IsX[y.type] =:= IsX[z.type]] // error

def test2 = summon[
(
y.type match
case x.type => true
case _ => false
) =:= (
z.type match
case x.type => true
case _ => false
)
] // error

0 comments on commit fcc753b

Please sign in to comment.