Skip to content

Improve documentatino for Symbol.tree #11767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3460,14 +3460,28 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
def docstring: Option[String]

/** Tree of this definition
*
* If this symbol `isClassDef` it will return `a `ClassDef`,
* if this symbol `isTypeDef` it will return `a `TypeDef`,
* if this symbol `isValDef` it will return `a `ValDef`,
* if this symbol `isDefDef` it will return `a `DefDef`
* if this symbol `isBind` it will return `a `Bind`,
* else will throw
*/
*
* If this symbol `isClassDef` it will return `a `ClassDef`,
* if this symbol `isTypeDef` it will return `a `TypeDef`,
* if this symbol `isValDef` it will return `a `ValDef`,
* if this symbol `isDefDef` it will return `a `DefDef`
* if this symbol `isBind` it will return `a `Bind`,
* else will throw
*
* **Warning**: avoid using this method in macros.
*
* **Caveat**: The tree is not guaranteed to exist unless the compiler
* option `-Yretain-trees` is enabled.
*
* **Anti-pattern**: The following code is an anti-pattern:
*
* symbol.tree.info
*
* It should be replaced by the following code:
*
* tp.memberType(symbol)
*
*/
def tree: Tree

/** Is the annotation defined with `annotSym` attached to this symbol? */
Expand Down