Skip to content

Commit 5fbdf09

Browse files
committed
chore: add regression test for #24096
1 parent a4e1309 commit 5fbdf09

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/neg/i24096.check

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- [E007] Type Mismatch Error: tests/neg/i24096.scala:8:31 -------------------------------------------------------------
2+
8 | case r: Terminal[?] => r // error
3+
| ^
4+
| Found: (r : Pull[F, O, Unit] & Pull.Terminal[_])
5+
| Required: Pull[F2, O2, Unit]
6+
|
7+
| where: F is a type in class StreamPullOps with bounds <: [_²] =>> Any
8+
| F2 is a type in method flatMapOutput with bounds >: [x] =>> F[x] and <: [x] =>> Any
9+
|
10+
| longer explanation available when compiling with `-explain`

tests/neg/i24096.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
abstract class Pull[+F[_], +O, +R]
2+
object Pull:
3+
abstract class Terminal[+R] extends Pull[Nothing, Nothing, R]
4+
5+
class StreamPullOps[F[_], O](self: Pull[F, O, Unit]):
6+
def flatMapOutput[F2[x] >: F[x], O2](): Pull[F2, O2, Unit] =
7+
self match
8+
case r: Terminal[?] => r // error
9+
case _ => ???

0 commit comments

Comments
 (0)