diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index 963b9eeadc4b..4c5eba0a28a8 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -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 `New` applied to the parameters 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 @@ -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. */ @@ -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 @@ -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