@@ -37,46 +37,46 @@ object TypeToolbox {
37
37
inline def caseFields [T ]: List [String ] = $ {caseFieldsImpl(' [T ])}
38
38
private def caseFieldsImpl (tp : Type [_])(given qctx : QuoteContext ): Expr [List [String ]] = {
39
39
import qctx .tasty ._
40
- val fields = tp.unseal.symbol.asClassDef. caseFields.map(_.name)
40
+ val fields = tp.unseal.symbol.caseFields.map(_.name)
41
41
Expr (fields)
42
42
}
43
43
44
44
inline def fieldIn [T ](inline mem : String ): String = $ {fieldInImpl(' [T ], mem)}
45
45
private def fieldInImpl (t : Type [_], mem : String )(given qctx : QuoteContext ): Expr [String ] = {
46
46
import qctx .tasty ._
47
- val field = t.unseal.symbol.asClassDef. field(mem)
47
+ val field = t.unseal.symbol.field(mem)
48
48
Expr (if field.isNoSymbol then " " else field.name)
49
49
}
50
50
51
51
inline def fieldsIn [T ]: Seq [String ] = $ {fieldsInImpl(' [T ])}
52
52
private def fieldsInImpl (t : Type [_])(given qctx : QuoteContext ): Expr [Seq [String ]] = {
53
53
import qctx .tasty ._
54
- val fields = t.unseal.symbol.asClassDef. fields
54
+ val fields = t.unseal.symbol.fields
55
55
Expr (fields.map(_.name).toList)
56
56
}
57
57
58
58
inline def methodIn [T ](inline mem : String ): Seq [String ] = $ {methodInImpl(' [T ], mem)}
59
59
private def methodInImpl (t : Type [_], mem : String )(given qctx : QuoteContext ): Expr [Seq [String ]] = {
60
60
import qctx .tasty ._
61
- Expr (t.unseal.symbol.asClassDef. classMethod(mem).map(_.name))
61
+ Expr (t.unseal.symbol.classMethod(mem).map(_.name))
62
62
}
63
63
64
64
inline def methodsIn [T ]: Seq [String ] = $ {methodsInImpl(' [T ])}
65
65
private def methodsInImpl (t : Type [_])(given qctx : QuoteContext ): Expr [Seq [String ]] = {
66
66
import qctx .tasty ._
67
- Expr (t.unseal.symbol.asClassDef. classMethods.map(_.name))
67
+ Expr (t.unseal.symbol.classMethods.map(_.name))
68
68
}
69
69
70
70
inline def method [T ](inline mem : String ): Seq [String ] = $ {methodImpl(' [T ], mem)}
71
71
private def methodImpl (t : Type [_], mem : String )(given qctx : QuoteContext ): Expr [Seq [String ]] = {
72
72
import qctx .tasty ._
73
- Expr (t.unseal.symbol.asClassDef. method(mem).map(_.name))
73
+ Expr (t.unseal.symbol.method(mem).map(_.name))
74
74
}
75
75
76
76
inline def methods [T ]: Seq [String ] = $ {methodsImpl(' [T ])}
77
77
private def methodsImpl (t : Type [_])(given qctx : QuoteContext ): Expr [Seq [String ]] = {
78
78
import qctx .tasty ._
79
- Expr (t.unseal.symbol.asClassDef. methods.map(_.name))
79
+ Expr (t.unseal.symbol.methods.map(_.name))
80
80
}
81
81
82
82
inline def typeTag [T ](x : T ): String = $ {typeTagImpl(' [T ])}
@@ -89,7 +89,7 @@ object TypeToolbox {
89
89
inline def companion [T1 , T2 ]: Boolean = $ {companionImpl(' [T1 ], ' [T2 ])}
90
90
private def companionImpl (t1 : Type [_], t2 : Type [_])(given qctx : QuoteContext ): Expr [Boolean ] = {
91
91
import qctx .tasty ._
92
- val res = t1.unseal.symbol.asClassDef. companionModule == t2.unseal.symbol
92
+ val res = t1.unseal.symbol.companionModule == t2.unseal.symbol
93
93
Expr (res)
94
94
}
95
95
0 commit comments