File tree Expand file tree Collapse file tree 6 files changed +13
-13
lines changed
docs/docs/reference/other-new-features
library/src/scala/tasty/reflect
tests/run-custom-args/Yretain-trees Expand file tree Collapse file tree 6 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ TASTy Reflect provides the following types:
182182 +- TypeDefSymbol
183183 +- DefDefSymbol
184184 +- ValDefSymbol
185- +- BindDefSymbol
185+ +- BindSymbol
186186 +- NoSymbol
187187
188188```
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ package scala.tasty.reflect
105105 * +- TypeDefSymbol
106106 * +- DefDefSymbol
107107 * +- ValDefSymbol
108- * +- BindDefSymbol
108+ * +- BindSymbol
109109 * +- NoSymbol
110110 *
111111 * +- Flags
@@ -433,7 +433,7 @@ trait Core {
433433 type ValDefSymbol = kernel.ValDefSymbol
434434
435435 /** Symbol representing a bind definition. */
436- type BindDefSymbol = kernel.BindSymbol
436+ type BindSymbol = kernel.BindSymbol
437437
438438 /** No symbol available. */
439439 type NoSymbol = kernel.NoSymbol
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ package scala.tasty.reflect
104104 * +- TypeDefSymbol
105105 * +- DefDefSymbol
106106 * +- ValDefSymbol
107- * +- BindDefSymbol
107+ * +- BindSymbol
108108 * +- NoSymbol
109109 *
110110 * +- Flags
Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ trait SymbolOps extends Core {
6464 case _ => throw new Exception (" not a TypeDefSymbol" )
6565 }
6666
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 " )
67+ /** Unsafe cast as to BindSymbol. Use IsBindSymbol to safely check and cast to BindSymbol */
68+ def asBindDef (implicit ctx : Context ): BindSymbol = self match {
69+ case IsBindSymbol (self) => self
70+ case _ => throw new Exception (" not a BindSymbol " )
7171 }
7272
7373 /** Annotations attached to this symbol */
@@ -210,12 +210,12 @@ trait SymbolOps extends Core {
210210
211211 // BindSymbol
212212
213- object IsBindDefSymbol {
214- def unapply (symbol : Symbol )(implicit ctx : Context ): Option [BindDefSymbol ] =
213+ object IsBindSymbol {
214+ def unapply (symbol : Symbol )(implicit ctx : Context ): Option [BindSymbol ] =
215215 kernel.matchBindSymbol(symbol)
216216 }
217217
218- implicit class BindDefSymbolAPI (self : BindDefSymbol ) {
218+ implicit class BindSymbolAPI (self : BindSymbol ) {
219219 /** Bind pattern of this definition */
220220 def tree (implicit ctx : Context ): Bind =
221221 kernel.BindSymbol_tree (self)
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ object Foo {
1111 def definitionString (tree : Tree ): Expr [String ] = tree.symbol match {
1212 case IsDefDefSymbol (sym) => sym.tree.show.toExpr
1313 case IsValDefSymbol (sym) => sym.tree.show.toExpr
14- case IsBindDefSymbol (sym) => sym.tree.show.toExpr
14+ case IsBindSymbol (sym) => sym.tree.show.toExpr
1515 }
1616 x.unseal match {
1717 case Term .Inlined (None , Nil , arg) => definitionString(arg)
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ object Foo {
1111 def definitionString (tree : Tree ): Expr [String ] = tree.symbol match {
1212 case IsDefDefSymbol (sym) => sym.tree.show.toExpr
1313 case IsValDefSymbol (sym) => sym.tree.show.toExpr
14- case IsBindDefSymbol (sym) => sym.tree.show.toExpr
14+ case IsBindSymbol (sym) => sym.tree.show.toExpr
1515 }
1616 x.unseal match {
1717 case Term .Inlined (None , Nil , arg) => definitionString(arg)
You can’t perform that action at this time.
0 commit comments