@@ -34,40 +34,40 @@ trait SymbolOps extends Core {
3434 /** The comment for this symbol, if any */
3535 def comment (implicit ctx : Context ): Option [Comment ] = kernel.Symbol_comment (self)
3636
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 " )
4141 }
4242
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 " )
4747 }
4848
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 " )
5353 }
5454
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 " )
5959 }
6060
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 " )
6565 }
6666
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 " )
7171 }
7272
7373 /** Annotations attached to this symbol */
@@ -86,30 +86,30 @@ trait SymbolOps extends Core {
8686
8787 // PackageSymbol
8888
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 ] =
9191 kernel.matchPackageDefSymbol(symbol)
9292 }
9393
94- implicit class PackageSymbolAPI (self : PackageSymbol ) {
94+ implicit class PackageDefSymbolAPI (self : PackageDefSymbol ) {
9595 def tree (implicit ctx : Context ): PackageDef =
9696 kernel.PackageDefSymbol_tree (self)
9797 }
9898
9999 // ClassSymbol
100100
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 ] =
103103 kernel.matchClassDefSymbol(symbol)
104104 }
105105
106- object ClassSymbol {
106+ object ClassDefSymbol {
107107 /** 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 =
109109 kernel.ClassDefSymbol_of (fullName)
110110 }
111111
112- implicit class ClassSymbolAPI (self : ClassSymbol ) {
112+ implicit class ClassDefSymbolAPI (self : ClassDefSymbol ) {
113113 /** ClassDef tree of this defintion */
114114 def tree (implicit ctx : Context ): ClassDef =
115115 kernel.ClassDefSymbol_tree (self)
@@ -123,31 +123,31 @@ trait SymbolOps extends Core {
123123 kernel.ClassDefSymbol_field (self)(name)
124124
125125 /** 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 ] =
127127 kernel.ClassDefSymbol_classMethod (self)(name)
128128
129129 /** 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 ] =
131131 kernel.ClassDefSymbol_classMethods (self)
132132
133133 /** 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 ] =
135135 kernel.ClassDefSymbol_method (self)(name)
136136
137137 /** Get all non-private methods declared or inherited */
138- def methods (implicit ctx : Context ): List [DefSymbol ] =
138+ def methods (implicit ctx : Context ): List [DefDefSymbol ] =
139139 kernel.ClassDefSymbol_methods (self)
140140
141141 /** 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 ] =
143143 kernel.ClassDefSymbol_caseFields (self)
144144
145145 /** The class symbol of the companion module class */
146- def companionClass (implicit ctx : Context ): Option [ClassSymbol ] =
146+ def companionClass (implicit ctx : Context ): Option [ClassDefSymbol ] =
147147 kernel.ClassDefSymbol_companionClass (self)
148148
149149 /** The symbol of the companion module */
150- def companionModule (implicit ctx : Context ): Option [ValSymbol ] =
150+ def companionModule (implicit ctx : Context ): Option [ValDefSymbol ] =
151151 kernel.ClassDefSymbol_companionModule (self)
152152
153153 /** The symbol of the class of the companion module */
@@ -157,12 +157,12 @@ trait SymbolOps extends Core {
157157
158158 // TypeSymbol
159159
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 ] =
162162 kernel.matchTypeDefSymbol(symbol)
163163 }
164164
165- implicit class TypeSymbolAPI (self : TypeSymbol ) {
165+ implicit class TypeDefSymbolAPI (self : TypeDefSymbol ) {
166166 /** TypeDef tree of this definition */
167167 def tree (implicit ctx : Context ): TypeDef =
168168 kernel.TypeDefSymbol_tree (self)
@@ -173,12 +173,12 @@ trait SymbolOps extends Core {
173173
174174 // DefSymbol
175175
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 ] =
178178 kernel.matchDefDefSymbol(symbol)
179179 }
180180
181- implicit class DefSymbolAPI (self : DefSymbol ) {
181+ implicit class DefDefSymbolAPI (self : DefDefSymbol ) {
182182 /** DefDef tree of this defintion */
183183 def tree (implicit ctx : Context ): DefDef =
184184 kernel.DefDefSymbol_tree (self)
@@ -190,32 +190,32 @@ trait SymbolOps extends Core {
190190
191191 // ValSymbol
192192
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 ] =
195195 kernel.matchValDefSymbol(symbol)
196196 }
197197
198- implicit class ValSymbolAPI (self : ValSymbol ) {
198+ implicit class ValDefSymbolAPI (self : ValDefSymbol ) {
199199 /** ValDef tree of this defintion */
200200 def tree (implicit ctx : Context ): ValDef =
201201 kernel.ValDefSymbol_tree (self)
202202
203203 /** The class symbol of the companion module class */
204- def moduleClass (implicit ctx : Context ): Option [ClassSymbol ] =
204+ def moduleClass (implicit ctx : Context ): Option [ClassDefSymbol ] =
205205 kernel.ValDefSymbol_moduleClass (self)
206206
207- def companionClass (implicit ctx : Context ): Option [ClassSymbol ] =
207+ def companionClass (implicit ctx : Context ): Option [ClassDefSymbol ] =
208208 kernel.ValDefSymbol_companionClass (self)
209209 }
210210
211211 // BindSymbol
212212
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 ] =
215215 kernel.matchBindSymbol(symbol)
216216 }
217217
218- implicit class BindSymbolAPI (self : BindSymbol ) {
218+ implicit class BindDefSymbolAPI (self : BindDefSymbol ) {
219219 /** Bind pattern of this definition */
220220 def tree (implicit ctx : Context ): Bind =
221221 kernel.BindSymbol_tree (self)
0 commit comments