File tree 2 files changed +6
-0
lines changed
compiler/src/dotty/tools/dotc/printing 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
165
165
private def toTextRetainedElem [T <: Untyped ](ref : Tree [T ]): Text = ref match
166
166
case ref : RefTree [? ] if ref.typeOpt.exists =>
167
167
toTextCaptureRef(ref.typeOpt)
168
+ case TypeApply (fn, arg :: Nil ) if fn.symbol == defn.Caps_capsOf =>
169
+ toTextRetainedElem(arg)
168
170
case _ =>
169
171
toText(ref)
170
172
@@ -416,6 +418,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
416
418
case tp : SingletonType => toTextRef(tp)
417
419
case ReachCapability (tp1) => toTextRef(tp1) ~ " *"
418
420
case MaybeCapability (tp1) => toTextRef(tp1) ~ " ?"
421
+ case tp : (TypeRef | TypeParamRef ) => toText(tp) ~ " ^"
419
422
case _ => toText(tp)
420
423
421
424
protected def isOmittablePrefix (sym : Symbol ): Boolean =
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import caps.{CapSet, Capability}
9
9
10
10
def f [X ^ ](x : D ^ {X ^ }): D ^ {X ^ } = x
11
11
def g [X ^ ](x : D ^ {X ^ }, y : D ^ {X ^ }): D ^ {X ^ } = x
12
+ def h [X ^ ](): D ^ {X ^ } = ???
12
13
13
14
def test (c1 : C , c2 : C ) =
14
15
val d : D ^ {c1, c2} = D ()
@@ -19,5 +20,7 @@ import caps.{CapSet, Capability}
19
20
val y = g(d1, d2)
20
21
val _: D ^ {d1, d2} = y
21
22
val _: D ^ {c1, c2} = y
23
+ val z = h()
24
+
22
25
23
26
You can’t perform that action at this time.
0 commit comments