We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8a603c6 + e38316e commit 5e8ee91Copy full SHA for 5e8ee91
tests/pos/i11255.scala
@@ -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