Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Mar 16, 2022
1 parent f4113da commit 072c154
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,10 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
trait ClassDefModule { this: ClassDef.type =>
/** Create a class definition tree
*
* @param cls The class symbol
* @param cls The class symbol. A new class symbol can be created using `Symbol.newClass`.
* @param parents The parents trees class. The trees must align with the parent types of `cls`.
* Parents can be `TypeTree`s if they don't have term parameter,
* otherwise the can be `Term` containing the instantiation of the extended class.
* @param body List of members of the class. The members must align with the members of `cls`.
*/
@experimental def apply(cls: Symbol, parents: List[Tree /* Term | TypeTree */], body: List[Statement]): ClassDef
Expand Down Expand Up @@ -2531,6 +2533,11 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
def typeSymbol: Symbol
def termSymbol: Symbol
def isSingleton: Boolean

/** This type seen as if it were the type of a member of prefix type `self` declared in class `member.owner`.
*
* Also see `typeRef` and `termRef`
*/
def memberType(member: Symbol): TypeRepr

/** The base classes of this type with the class itself as first element. */
Expand Down Expand Up @@ -3701,9 +3708,11 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
*
* symbol.tree.tpe
*
* It should be replaced by the following code:
* It should be replaced by one of the following:
*
* tp.memberType(symbol)
* symbol.typeRef
* symbol.termRef
*
*/
def tree: Tree
Expand Down Expand Up @@ -3875,7 +3884,12 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
/** Case class or case object children of a sealed trait or cases of an `enum`. */
def children: List[Symbol]

/** Type reference to the symbol usable in the scope of its owner. */
/** Type reference to the symbol usable in the scope of its owner.
*
* To get a reference to a symbol from a specific prefix `tp`, use `tp.memberType(symbol)` instead.
*
* @pre symbol.isType returns true
*/
@experimental
def typeRef: TypeRef

Expand Down

0 comments on commit 072c154

Please sign in to comment.