@@ -34,40 +34,40 @@ trait SymbolOps extends Core {
34
34
/** The comment for this symbol, if any */
35
35
def comment (implicit ctx : Context ): Option [Comment ] = kernel.Symbol_comment (self)
36
36
37
- /** Unsafe cast as to PackageSymbol. Use IsPackageSymbol to safly check and cast to PackageSymbol */
38
- def asPackage (implicit ctx : Context ): PackageSymbol = self match {
39
- case IsPackageSymbol (self) => self
40
- case _ => throw new Exception (" not a PackageSymbol " )
37
+ /** Unsafe cast as to PackageSymbol. Use IsPackageSymbol to safely check and cast to PackageSymbol */
38
+ def asPackageDef (implicit ctx : Context ): PackageDefSymbol = self match {
39
+ case IsPackageDefSymbol (self) => self
40
+ case _ => throw new Exception (" not a PackageDefSymbol " )
41
41
}
42
42
43
- /** Unsafe cast as to ClassSymbol. Use IsClassSymbol to safly check and cast to ClassSymbol */
44
- def asClass (implicit ctx : Context ): ClassSymbol = self match {
45
- case IsClassSymbol (self) => self
46
- case _ => throw new Exception (" not a ClassSymbol " )
43
+ /** Unsafe cast as to ClassSymbol. Use IsClassDefSymbol to safely check and cast to ClassSymbol */
44
+ def asClassDef (implicit ctx : Context ): ClassDefSymbol = self match {
45
+ case IsClassDefSymbol (self) => self
46
+ case _ => throw new Exception (" not a ClassDefSymbol " )
47
47
}
48
48
49
- /** Unsafe cast as to DefSymbol. Use IsDefSymbol to safly check and cast to DefSymbol */
50
- def asDef (implicit ctx : Context ): DefSymbol = self match {
51
- case IsDefSymbol (self) => self
52
- case _ => throw new Exception (" not a DefSymbol " )
49
+ /** Unsafe cast as to DefSymbol. Use IsDefDefSymbol to safely check and cast to DefSymbol */
50
+ def asDefDef (implicit ctx : Context ): DefDefSymbol = self match {
51
+ case IsDefDefSymbol (self) => self
52
+ case _ => throw new Exception (" not a DefDefSymbol " )
53
53
}
54
54
55
- /** Unsafe cast as to ValSymbol. Use IsValSymbol to safly check and cast to ValSymbol */
56
- def asVal (implicit ctx : Context ): ValSymbol = self match {
57
- case IsValSymbol (self) => self
58
- case _ => throw new Exception (" not a ValSymbol " )
55
+ /** Unsafe cast as to ValSymbol. Use IsValDefSymbol to safely check and cast to ValSymbol */
56
+ def asValDef (implicit ctx : Context ): ValDefSymbol = self match {
57
+ case IsValDefSymbol (self) => self
58
+ case _ => throw new Exception (" not a ValDefSymbol " )
59
59
}
60
60
61
- /** Unsafe cast as to TypeSymbol. Use IsTypeSymbol to safly check and cast to TypeSymbol */
62
- def asType (implicit ctx : Context ): TypeSymbol = self match {
63
- case IsTypeSymbol (self) => self
64
- case _ => throw new Exception (" not a TypeSymbol " )
61
+ /** Unsafe cast as to TypeSymbol. Use IsTypeDefSymbol to safely check and cast to TypeSymbol */
62
+ def asTypeDef (implicit ctx : Context ): TypeDefSymbol = self match {
63
+ case IsTypeDefSymbol (self) => self
64
+ case _ => throw new Exception (" not a TypeDefSymbol " )
65
65
}
66
66
67
- /** Unsafe cast as to BindSymbol. Use IsBindSymbol to safly check and cast to BindSymbol */
68
- def asBind (implicit ctx : Context ): BindSymbol = self match {
69
- case IsBindSymbol (self) => self
70
- case _ => throw new Exception (" not a BindSymbol " )
67
+ /** Unsafe cast as to BindSymbol. Use IsBindDefSymbol to safely check and cast to BindSymbol */
68
+ def asBindDef (implicit ctx : Context ): BindDefSymbol = self match {
69
+ case IsBindDefSymbol (self) => self
70
+ case _ => throw new Exception (" not a BindDefSymbol " )
71
71
}
72
72
73
73
/** Annotations attached to this symbol */
@@ -86,30 +86,30 @@ trait SymbolOps extends Core {
86
86
87
87
// PackageSymbol
88
88
89
- object IsPackageSymbol {
90
- def unapply (symbol : Symbol )(implicit ctx : Context ): Option [PackageSymbol ] =
89
+ object IsPackageDefSymbol {
90
+ def unapply (symbol : Symbol )(implicit ctx : Context ): Option [PackageDefSymbol ] =
91
91
kernel.matchPackageDefSymbol(symbol)
92
92
}
93
93
94
- implicit class PackageSymbolAPI (self : PackageSymbol ) {
94
+ implicit class PackageDefSymbolAPI (self : PackageDefSymbol ) {
95
95
def tree (implicit ctx : Context ): PackageDef =
96
96
kernel.PackageDefSymbol_tree (self)
97
97
}
98
98
99
99
// ClassSymbol
100
100
101
- object IsClassSymbol {
102
- def unapply (symbol : Symbol )(implicit ctx : Context ): Option [ClassSymbol ] =
101
+ object IsClassDefSymbol {
102
+ def unapply (symbol : Symbol )(implicit ctx : Context ): Option [ClassDefSymbol ] =
103
103
kernel.matchClassDefSymbol(symbol)
104
104
}
105
105
106
- object ClassSymbol {
106
+ object ClassDefSymbol {
107
107
/** The ClassSymbol of a global class definition */
108
- def of (fullName : String )(implicit ctx : Context ): ClassSymbol =
108
+ def of (fullName : String )(implicit ctx : Context ): ClassDefSymbol =
109
109
kernel.ClassDefSymbol_of (fullName)
110
110
}
111
111
112
- implicit class ClassSymbolAPI (self : ClassSymbol ) {
112
+ implicit class ClassDefSymbolAPI (self : ClassDefSymbol ) {
113
113
/** ClassDef tree of this defintion */
114
114
def tree (implicit ctx : Context ): ClassDef =
115
115
kernel.ClassDefSymbol_tree (self)
@@ -123,31 +123,31 @@ trait SymbolOps extends Core {
123
123
kernel.ClassDefSymbol_field (self)(name)
124
124
125
125
/** Get non-private named methods defined directly inside the class */
126
- def classMethod (name : String )(implicit ctx : Context ): List [DefSymbol ] =
126
+ def classMethod (name : String )(implicit ctx : Context ): List [DefDefSymbol ] =
127
127
kernel.ClassDefSymbol_classMethod (self)(name)
128
128
129
129
/** Get all non-private methods defined directly inside the class, exluding constructors */
130
- def classMethods (implicit ctx : Context ): List [DefSymbol ] =
130
+ def classMethods (implicit ctx : Context ): List [DefDefSymbol ] =
131
131
kernel.ClassDefSymbol_classMethods (self)
132
132
133
133
/** Get named non-private methods declared or inherited */
134
- def method (name : String )(implicit ctx : Context ): List [DefSymbol ] =
134
+ def method (name : String )(implicit ctx : Context ): List [DefDefSymbol ] =
135
135
kernel.ClassDefSymbol_method (self)(name)
136
136
137
137
/** Get all non-private methods declared or inherited */
138
- def methods (implicit ctx : Context ): List [DefSymbol ] =
138
+ def methods (implicit ctx : Context ): List [DefDefSymbol ] =
139
139
kernel.ClassDefSymbol_methods (self)
140
140
141
141
/** Fields of a case class type -- only the ones declared in primary constructor */
142
- def caseFields (implicit ctx : Context ): List [ValSymbol ] =
142
+ def caseFields (implicit ctx : Context ): List [ValDefSymbol ] =
143
143
kernel.ClassDefSymbol_caseFields (self)
144
144
145
145
/** The class symbol of the companion module class */
146
- def companionClass (implicit ctx : Context ): Option [ClassSymbol ] =
146
+ def companionClass (implicit ctx : Context ): Option [ClassDefSymbol ] =
147
147
kernel.ClassDefSymbol_companionClass (self)
148
148
149
149
/** The symbol of the companion module */
150
- def companionModule (implicit ctx : Context ): Option [ValSymbol ] =
150
+ def companionModule (implicit ctx : Context ): Option [ValDefSymbol ] =
151
151
kernel.ClassDefSymbol_companionModule (self)
152
152
153
153
/** The symbol of the class of the companion module */
@@ -157,12 +157,12 @@ trait SymbolOps extends Core {
157
157
158
158
// TypeSymbol
159
159
160
- object IsTypeSymbol {
161
- def unapply (symbol : Symbol )(implicit ctx : Context ): Option [TypeSymbol ] =
160
+ object IsTypeDefSymbol {
161
+ def unapply (symbol : Symbol )(implicit ctx : Context ): Option [TypeDefSymbol ] =
162
162
kernel.matchTypeDefSymbol(symbol)
163
163
}
164
164
165
- implicit class TypeSymbolAPI (self : TypeSymbol ) {
165
+ implicit class TypeDefSymbolAPI (self : TypeDefSymbol ) {
166
166
/** TypeDef tree of this definition */
167
167
def tree (implicit ctx : Context ): TypeDef =
168
168
kernel.TypeDefSymbol_tree (self)
@@ -173,12 +173,12 @@ trait SymbolOps extends Core {
173
173
174
174
// DefSymbol
175
175
176
- object IsDefSymbol {
177
- def unapply (symbol : Symbol )(implicit ctx : Context ): Option [DefSymbol ] =
176
+ object IsDefDefSymbol {
177
+ def unapply (symbol : Symbol )(implicit ctx : Context ): Option [DefDefSymbol ] =
178
178
kernel.matchDefDefSymbol(symbol)
179
179
}
180
180
181
- implicit class DefSymbolAPI (self : DefSymbol ) {
181
+ implicit class DefDefSymbolAPI (self : DefDefSymbol ) {
182
182
/** DefDef tree of this defintion */
183
183
def tree (implicit ctx : Context ): DefDef =
184
184
kernel.DefDefSymbol_tree (self)
@@ -190,32 +190,32 @@ trait SymbolOps extends Core {
190
190
191
191
// ValSymbol
192
192
193
- object IsValSymbol {
194
- def unapply (symbol : Symbol )(implicit ctx : Context ): Option [ValSymbol ] =
193
+ object IsValDefSymbol {
194
+ def unapply (symbol : Symbol )(implicit ctx : Context ): Option [ValDefSymbol ] =
195
195
kernel.matchValDefSymbol(symbol)
196
196
}
197
197
198
- implicit class ValSymbolAPI (self : ValSymbol ) {
198
+ implicit class ValDefSymbolAPI (self : ValDefSymbol ) {
199
199
/** ValDef tree of this defintion */
200
200
def tree (implicit ctx : Context ): ValDef =
201
201
kernel.ValDefSymbol_tree (self)
202
202
203
203
/** The class symbol of the companion module class */
204
- def moduleClass (implicit ctx : Context ): Option [ClassSymbol ] =
204
+ def moduleClass (implicit ctx : Context ): Option [ClassDefSymbol ] =
205
205
kernel.ValDefSymbol_moduleClass (self)
206
206
207
- def companionClass (implicit ctx : Context ): Option [ClassSymbol ] =
207
+ def companionClass (implicit ctx : Context ): Option [ClassDefSymbol ] =
208
208
kernel.ValDefSymbol_companionClass (self)
209
209
}
210
210
211
211
// BindSymbol
212
212
213
- object IsBindSymbol {
214
- def unapply (symbol : Symbol )(implicit ctx : Context ): Option [BindSymbol ] =
213
+ object IsBindDefSymbol {
214
+ def unapply (symbol : Symbol )(implicit ctx : Context ): Option [BindDefSymbol ] =
215
215
kernel.matchBindSymbol(symbol)
216
216
}
217
217
218
- implicit class BindSymbolAPI (self : BindSymbol ) {
218
+ implicit class BindDefSymbolAPI (self : BindDefSymbol ) {
219
219
/** Bind pattern of this definition */
220
220
def tree (implicit ctx : Context ): Bind =
221
221
kernel.BindSymbol_tree (self)
0 commit comments