File tree 1 file changed +48
-0
lines changed
1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ import scala .quoted ._
3
+
4
+ trait App [F [_],CT ]:
5
+ this : Base [F ,CT ] =>
6
+
7
+ import qctx .tasty ._
8
+
9
+ trait AA
10
+
11
+ def f (cpsCtx : FC [F ]): AA =
12
+ g(cpsCtx)
13
+
14
+ def g (cpsCtx : FC [F ]): AA =
15
+ val paramSym : Symbol = ???
16
+ println(paramSym.tree) // println necessary for failure
17
+ val t : Term = ???
18
+ t match { // match necessary for failure
19
+ case Typed (_, _) => ??? // both cases necessary for failure
20
+ case Lambda (_, _) => ???
21
+ }
22
+ f(cpsCtx) // necessary for failure
23
+ val cpsBody = runRoot() // necessary for failure
24
+ g(cpsCtx) // failure
25
+ // 26 | g(cpsCtx)
26
+ // | ^
27
+ // |Ambiguous overload. The overloaded alternatives of method g in trait App with types
28
+ // | (cpsCtx: FC[F]): Base.this.AA
29
+ // | (cpsCtx: FC[F]): App.this.AA
30
+ // |both match arguments ((cpsCtx : FC[F]))
31
+ // |
32
+ // |Note: this happens because two or more alternatives have the same erasure,
33
+ // | so they cannot be distinguished by overloading resolution
34
+
35
+
36
+ class FC [F [_]]()
37
+
38
+ trait Base [F [_]: Type ,CT : Type ] // Both :Type context bounds are necessary for failure
39
+ extends Cps with Root [F , CT ] with App [F , CT ]:
40
+ implicit val qctx : QuoteContext
41
+
42
+ trait Root [F [_], CT ]:
43
+ this : Base [F , CT ] =>
44
+ def runRoot (): CpsTree = ???
45
+
46
+ trait Cps :
47
+ sealed abstract class CpsTree
48
+
You can’t perform that action at this time.
0 commit comments