Skip to content

Commit 5e8ee91

Browse files
test: add in a regression test for #11255 (#17497)
[skip community_build] closes #11255
2 parents 8a603c6 + e38316e commit 5e8ee91

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/pos/i11255.scala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
class A
2+
class B extends A
3+
4+
object O:
5+
opaque type Id[T] = T
6+
extension [T](id: Id[T]) def get: T = id
7+
def f[S <: A, T](ff: S => T): Id[S => T] = ???
8+
def g[S <: A, T](ff: S => T): Option[S => T] = ???
9+
def h[S, T](ff: S => T): Id[S => T] = ???
10+
11+
object example:
12+
import O._
13+
14+
val a = new A
15+
val b = new B
16+
17+
val f1 = f((a: A) => 0)
18+
f1.get.apply(a)
19+
val f2 = f((b: B) => 0)
20+
f2.get.apply(b)
21+
22+
val g1 = g((a: A) => 0)
23+
g1.get.apply(a)
24+
25+
val h1 = h((a: A) => 0)
26+
h1.get.apply(a)

0 commit comments

Comments
 (0)