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 8163bff + d87b9c2 commit 2ee7f74Copy full SHA for 2ee7f74
tests/pos/i12910.scala
@@ -0,0 +1,27 @@
1
+trait Type[T]:
2
+ type Out
3
+
4
+type varchar
5
6
+given Type[varchar] with
7
+ type Out = String
8
9
+class Placeholder[T, U]
10
11
+object Placeholder:
12
+ def apply[T](using t: Type[T]): Placeholder[T, t.Out] = new Placeholder
13
14
+trait Encoder[P, X]:
15
+ def encode(x: X): String
16
17
+object Encoder:
18
+ def apply[P, X](placeholder: P)(using e: Encoder[P, X]): X => String = e.encode
19
20
+ given [T, X]: Encoder[Placeholder[T, X], X] with
21
+ def encode(x: X): String = ???
22
23
+def Test =
24
+ // the following compiles just fine
25
+ Encoder(new Placeholder[varchar, String])("hello")
26
+ // the following fails
27
+ Encoder(Placeholder[varchar])("hello")
0 commit comments