@@ -466,8 +466,10 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
466
466
trait ClassDefModule { this : ClassDef .type =>
467
467
/** Create a class definition tree
468
468
*
469
- * @param cls The class symbol
469
+ * @param cls The class symbol. A new class symbol can be created using `Symbol.newClass`.
470
470
* @param parents The parents trees class. The trees must align with the parent types of `cls`.
471
+ * Parents can be `TypeTree`s if they don't have term parameter,
472
+ * otherwise the can be `Term` containing the `New` applied to the parameters of the extended class.
471
473
* @param body List of members of the class. The members must align with the members of `cls`.
472
474
*/
473
475
@ 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 =>
2531
2533
def typeSymbol : Symbol
2532
2534
def termSymbol : Symbol
2533
2535
def isSingleton : Boolean
2536
+
2537
+ /** This type seen as if it were the type of a member of prefix type `self` declared in class `member.owner`.
2538
+ *
2539
+ * Also see `typeRef` and `termRef`
2540
+ */
2534
2541
def memberType (member : Symbol ): TypeRepr
2535
2542
2536
2543
/** The base classes of this type with the class itself as first element. */
@@ -3701,9 +3708,11 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3701
3708
*
3702
3709
* symbol.tree.tpe
3703
3710
*
3704
- * It should be replaced by the following code :
3711
+ * It should be replaced by one of the following:
3705
3712
*
3706
3713
* tp.memberType(symbol)
3714
+ * symbol.typeRef
3715
+ * symbol.termRef
3707
3716
*
3708
3717
*/
3709
3718
def tree : Tree
@@ -3875,7 +3884,12 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3875
3884
/** Case class or case object children of a sealed trait or cases of an `enum`. */
3876
3885
def children : List [Symbol ]
3877
3886
3878
- /** Type reference to the symbol usable in the scope of its owner. */
3887
+ /** Type reference to the symbol usable in the scope of its owner.
3888
+ *
3889
+ * To get a reference to a symbol from a specific prefix `tp`, use `tp.memberType(symbol)` instead.
3890
+ *
3891
+ * @pre symbol.isType returns true
3892
+ */
3879
3893
@ experimental
3880
3894
def typeRef : TypeRef
3881
3895
0 commit comments