@@ -10,6 +10,7 @@ import util.Spans.Span
10
10
import core .Types .{ErrorType , MethodType , PolyType }
11
11
import reporting ._
12
12
13
+ import dotty .tools .dotc .core .Types .Type
13
14
14
15
object Signatures {
15
16
@@ -48,31 +49,40 @@ object Signatures {
48
49
*/
49
50
def callInfo (path : List [tpd.Tree ], span : Span )(using Context ): (Int , Int , List [SingleDenotation ]) =
50
51
path match {
52
+ case UnApply (fun, _, patterns) :: _ =>
53
+ callInfo(span, patterns, fun, 0 )
51
54
case Apply (fun, params) :: _ =>
52
55
val alreadyAppliedCount = Signatures .countParams(fun)
53
- val paramIndex = params.indexWhere(_.span.contains(span)) match {
54
- case - 1 => (params.length - 1 max 0 ) + alreadyAppliedCount
55
- case n => n + alreadyAppliedCount
56
- }
57
-
58
- val (alternativeIndex, alternatives) = fun.tpe match {
59
- case err : ErrorType =>
60
- val (alternativeIndex, alternatives) = alternativesFromError(err, params)
61
- (alternativeIndex, alternatives)
56
+ callInfo(span, params, fun, alreadyAppliedCount)
57
+ case _ =>
58
+ (0 , 0 , Nil )
59
+ }
62
60
63
- case _ =>
64
- val funSymbol = fun.symbol
65
- val alternatives = funSymbol.owner.info.member(funSymbol.name).alternatives
66
- val alternativeIndex = alternatives.map(_.symbol).indexOf(funSymbol) max 0
67
- (alternativeIndex, alternatives)
68
- }
61
+ def callInfo (
62
+ span : Span ,
63
+ params : List [Tree [Type ]],
64
+ fun : Tree [Type ],
65
+ alreadyAppliedCount : Int
66
+ )(using Context ): (Int , Int , List [SingleDenotation ]) =
67
+ val paramIndex = params.indexWhere(_.span.contains(span)) match {
68
+ case - 1 => (params.length - 1 max 0 ) + alreadyAppliedCount
69
+ case n => n + alreadyAppliedCount
70
+ }
69
71
70
- (paramIndex, alternativeIndex, alternatives)
72
+ val (alternativeIndex, alternatives) = fun.tpe match {
73
+ case err : ErrorType =>
74
+ val (alternativeIndex, alternatives) = alternativesFromError(err, params)
75
+ (alternativeIndex, alternatives)
71
76
72
77
case _ =>
73
- (0 , 0 , Nil )
78
+ val funSymbol = fun.symbol
79
+ val alternatives = funSymbol.owner.info.member(funSymbol.name).alternatives
80
+ val alternativeIndex = alternatives.map(_.symbol).indexOf(funSymbol) max 0
81
+ (alternativeIndex, alternatives)
74
82
}
75
83
84
+ (paramIndex, alternativeIndex, alternatives)
85
+
76
86
def toSignature (denot : SingleDenotation )(using Context ): Option [Signature ] = {
77
87
val symbol = denot.symbol
78
88
val docComment = ParsedComment .docOf(symbol)
0 commit comments