@@ -96,7 +96,7 @@ trait TypesSupport:
96
96
97
97
// TODO #23 add support for all types signatures that make sense
98
98
private def inner (
99
- using Quotes ,
99
+ using q : Quotes ,
100
100
)(
101
101
tp : reflect.TypeRepr ,
102
102
skipThisTypePrefix : Boolean
@@ -122,7 +122,7 @@ trait TypesSupport:
122
122
++ keyword(" & " ).l
123
123
++ inParens(inner(right, skipThisTypePrefix), shouldWrapInParens(right, tp, false ))
124
124
case ByNameType (CapturingType (tpe, refs)) =>
125
- renderCaptureArrow(refs, skipThisTypePrefix) ++ (plain(" " ) :: inner(tpe, skipThisTypePrefix))
125
+ renderCaptureArrow(using q)( Some ( refs) , skipThisTypePrefix)( using elideThis, originalOwner ) ++ (plain(" " ) :: inner(tpe, skipThisTypePrefix))
126
126
case ByNameType (tpe) => keyword(" =>!! " ) :: inner(tpe, skipThisTypePrefix) // FIXME: does it need change for CC?
127
127
case ConstantType (constant) =>
128
128
plain(constant.show).l
@@ -342,15 +342,16 @@ trait TypesSupport:
342
342
s " ${tpe.show(using Printer .TypeReprStructure )}"
343
343
throw MatchError (msg)
344
344
345
- private def functionType (using Quotes )(t : reflect.TypeRepr , tpe : reflect.TypeRepr , args : List [reflect.TypeRepr ], skipThisTypePrefix : Boolean )(using
345
+ private def functionType (using q : Quotes )(t : reflect.TypeRepr , tpe : reflect.TypeRepr , args : List [reflect.TypeRepr ], skipThisTypePrefix : Boolean )(using
346
346
elideThis : reflect.ClassDef ,
347
347
indent : Int ,
348
348
originalOwner : reflect.Symbol ,
349
349
inCC : Option [List [reflect.TypeRepr ]],
350
350
): SSignature =
351
351
import reflect ._
352
352
val arrow = if t.isContextFunctionType then keyword(" ?=> " ).l // FIXME: can we have contextual functions with capture sets?
353
- else plain(" " ) :: (renderCaptureArrow(inCC, skipThisTypePrefix) ++ plain(" " ).l)
353
+ else plain(" " ) :: (renderCaptureArrow(using q)(inCC, skipThisTypePrefix) ++ plain(" " ).l)
354
+ given Option [List [TypeRepr ]] = None
354
355
args match
355
356
case Nil => Nil
356
357
case List (rtpe) => plain(" ()" ).l ++ arrow ++ inner(rtpe, skipThisTypePrefix)
@@ -498,19 +499,19 @@ trait TypesSupport:
498
499
import reflect ._
499
500
Keyword (" ^" ) :: renderCaptureSet(refs, skipThisTypePrefix)
500
501
501
- private def renderCaptureArrow (using Quotes )(refs : List [reflect.TypeRepr ], skipThisTypePrefix : Boolean )(
502
+ private def renderCaptureArrow (using q : Quotes )(refs : List [reflect.TypeRepr ], skipThisTypePrefix : Boolean )(
502
503
using elideThis : reflect.ClassDef , originalOwner : reflect.Symbol
503
504
): SSignature =
504
- import reflect ._
505
+ import reflect .*
505
506
refs match
506
507
case Nil => List (Keyword (" ->" ))
507
508
case List (ref) if ref.isCaptureRoot => List (Keyword (" =>" ))
508
- case refs => Keyword (" ->" ) :: renderCaptureSet(refs, skipThisTypePrefix)
509
+ case refs => Keyword (" ->" ) :: renderCaptureSet(using q)( refs, skipThisTypePrefix)
509
510
510
- private def renderCaptureArrow (using Quotes )(refs : Option [List [reflect.TypeRepr ]], skipThisTypePrefix : Boolean )(
511
+ private def renderCaptureArrow (using q : Quotes )(refs : Option [List [reflect.TypeRepr ]], skipThisTypePrefix : Boolean )(
511
512
using elideThis : reflect.ClassDef , originalOwner : reflect.Symbol
512
513
): SSignature =
513
- import reflect ._
514
+ import reflect .*
514
515
refs match
515
516
case None => List (Keyword (" =>" )) // FIXME: is this correct? or should it be `->` by default?
516
- case Some (refs) => renderCaptureArrow(refs, skipThisTypePrefix)
517
+ case Some (refs) => renderCaptureArrow(using q)( refs, skipThisTypePrefix)
0 commit comments