@@ -17,36 +17,36 @@ trait InkuireSupport:
17
17
18
18
private given qctx .type = qctx
19
19
20
- private def paramsForClass (classDef : ClassDef , vars : Set [String ], isVariable : Boolean ): Seq [Inkuire .Variance ] =
21
- classDef.getTypeParams.map(mkTypeArgumentInkuire(_, vars, isVariable ))
20
+ private def paramsForClass (classDef : ClassDef , vars : Set [String ]): Seq [Inkuire .Variance ] =
21
+ classDef.getTypeParams.map(mkTypeArgumentInkuire(_, vars))
22
22
23
23
given TreeSyntaxInkuire : AnyRef with
24
24
extension (tpeTree : Tree )
25
- def asInkuire (vars : Set [String ], isVariable : Boolean ): Inkuire .Type =
26
- partialAsInkuire(vars, isVariable )(tpeTree)
25
+ def asInkuire (vars : Set [String ]): Inkuire .Type =
26
+ partialAsInkuire(vars)(tpeTree)
27
27
28
- def partialAsInkuire (vars : Set [String ], isVariable : Boolean ): PartialFunction [Tree , Inkuire .Type ] = {
28
+ def partialAsInkuire (vars : Set [String ]): PartialFunction [Tree , Inkuire .Type ] = {
29
29
case TypeBoundsTree (low, high) => inner(low.tpe, vars) // TODO [Inkuire] Type bounds
30
30
case tpeTree : Applied =>
31
31
inner(tpeTree.tpe, vars).copy(
32
- params = tpeTree.args.map(p => Inkuire .Invariance (p.asInkuire(vars, isVariable )))
32
+ params = tpeTree.args.map(p => Inkuire .Invariance (p.asInkuire(vars)))
33
33
)
34
34
case tpeTree : TypeTree =>
35
35
inner(tpeTree.tpe, vars)
36
36
case term : Term => inner(term.tpe, vars)
37
- case classDef : ClassDef => mkTypeFromClassDef(classDef, vars, isVariable )
37
+ case classDef : ClassDef => mkTypeFromClassDef(classDef, vars)
38
38
case typeDef : TypeDef =>
39
39
Inkuire .Type (
40
40
name = Inkuire .TypeName (typeDef.name),
41
41
itid = typeDef.symbol.itid
42
42
)
43
43
}
44
44
45
- def mkTypeFromClassDef (classDef : ClassDef , vars : Set [String ], isVariable : Boolean ): Inkuire .Type = {
45
+ def mkTypeFromClassDef (classDef : ClassDef , vars : Set [String ]): Inkuire .Type = {
46
46
Inkuire .Type (
47
47
name = Inkuire .TypeName (classDef.name),
48
48
itid = classDef.symbol.itid,
49
- params = paramsForClass(classDef, vars, isVariable )
49
+ params = paramsForClass(classDef, vars)
50
50
)
51
51
}
52
52
@@ -58,13 +58,13 @@ trait InkuireSupport:
58
58
extension (tpe : TypeRepr )
59
59
def asInkuire (vars : Set [String ]): Inkuire .Type = inner(tpe, vars)
60
60
61
- def mkTypeArgumentInkuire (argument : TypeDef , vars : Set [String ] = Set .empty, isVariable : Boolean = false ): Inkuire .Variance =
61
+ def mkTypeArgumentInkuire (argument : TypeDef , vars : Set [String ] = Set .empty): Inkuire .Variance =
62
62
val name = argument.symbol.normalizedName
63
63
val normalizedName = if name.matches(" _\\ $\\ d*" ) then " _" else name
64
64
val t = Inkuire .Type (
65
65
name = Inkuire .TypeName (normalizedName),
66
66
itid = argument.symbol.itid,
67
- isVariable = vars.contains(normalizedName) || isVariable ,
67
+ isVariable = true ,
68
68
params = Seq .empty // TODO [Inkuire] Type Lambdas
69
69
)
70
70
if argument.symbol.flags.is(Flags .Covariant ) then Inkuire .Covariance (t)
@@ -141,7 +141,7 @@ trait InkuireSupport:
141
141
Inkuire .Type .unresolved // TODO [Inkuire] <- should be handled by Singleton case, but didn't work
142
142
case MatchType (bond, sc, cases) =>
143
143
inner(sc, vars)
144
- case ParamRef (TypeLambda (names, _, resType ), i) =>
144
+ case ParamRef (TypeLambda (names, _, _ ), i) =>
145
145
Inkuire .Type (
146
146
name = Inkuire .TypeName (names(i)),
147
147
itid = Some (Inkuire .ITID (s " external-itid- ${names(i)}" , isParsed = false )),
0 commit comments