@@ -3852,10 +3852,9 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3852
3852
* @note As a macro can only splice code into the point at which it is expanded, all generated symbols must be
3853
3853
* direct or indirect children of the reflection context's owner.
3854
3854
*/
3855
- // TODO: add flags and privateWithin
3856
3855
@ experimental def newClass (owner : Symbol , name : String , parents : List [TypeRepr ], decls : Symbol => List [Symbol ], selfType : Option [TypeRepr ]): Symbol
3857
3856
3858
- /** Generates a new class symbol for a class with a public constructor.
3857
+ /** Generates a new class symbol for a class with a public single term clause constructor.
3859
3858
*
3860
3859
* @param owner The owner of the class
3861
3860
* @param name The name of the class
@@ -3866,7 +3865,13 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3866
3865
* @param conParamNames constructor parameter names.
3867
3866
* @param conParamTypes constructor parameter types.
3868
3867
*
3869
- * Parameters can be obtained via classSymbol.memberField
3868
+ * Parameters assigned by the constructor can be obtained via `classSymbol.memberField`.
3869
+ * This symbol starts without an accompanying definition.
3870
+ * It is the meta-programmer's responsibility to provide exactly one corresponding definition by passing
3871
+ * this symbol to the ClassDef constructor.
3872
+ *
3873
+ * @note As a macro can only splice code into the point at which it is expanded, all generated symbols must be
3874
+ * direct or indirect children of the reflection context's owner.
3870
3875
*/
3871
3876
@ experimental def newClass (
3872
3877
owner : Symbol ,
@@ -3879,24 +3884,32 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3879
3884
conParamTypes : List [TypeRepr ]
3880
3885
): Symbol
3881
3886
3882
- /**
3883
- *
3884
- *
3885
- * @param owner The owner of the class
3886
- * @param name The name of the class
3887
- * @param parents Function returning the parent classes of the class. The first parent must not be a trait
3888
- * Takes the constructed class symbol as an argument. Calling `cls.typeRef.asType` as part of this function will lead to cyclic reference errors.
3889
- * @param decls The member declarations of the class provided the symbol of this class
3890
- * @param selfType The self type of the class if it has one
3891
- * @param clsFlags extra flags with which the class symbol should be constructed
3892
- * @param clsPrivateWithin the symbol within which this new class symbol should be private. May be noSymbol
3893
- * @param conMethodType The MethodOrPoly type representing the type of the constructor.
3894
- * PolyType may only represent the first clause of the constructor.
3895
- * @param conFlags extra flags with which the constructor symbol should be constructed
3896
- * @param conPrivateWithin the symbol within which the constructor for this new class symbol should be private. May be noSymbol.
3897
- * @param conParamFlags extra flags with which the constructor parameter symbols should be constructed. Must match the shape of `conMethodType`.
3898
- *
3899
- */
3887
+ /** Generates a new class symbol with a constructor of the shape signified by a passed PolyOrMethod parameter.
3888
+ * TODO example with PolyType
3889
+ *
3890
+ * @param owner The owner of the class
3891
+ * @param name The name of the class
3892
+ * @param parents Function returning the parent classes of the class. The first parent must not be a trait
3893
+ * Takes the constructed class symbol as an argument. Calling `cls.typeRef.asType` as part of this function will lead to cyclic reference errors.
3894
+ * @param decls The member declarations of the class provided the symbol of this class
3895
+ * @param selfType The self type of the class if it has one
3896
+ * @param clsFlags extra flags with which the class symbol should be constructed
3897
+ * @param clsPrivateWithin the symbol within which this new class symbol should be private. May be noSymbol
3898
+ * @param conMethodType Function returning MethodOrPoly type representing the type of the constructor.
3899
+ * Takes the result type as parameter which must be returned from the innermost MethodOrPoly.
3900
+ * PolyType may only represent the first clause of the constructor.
3901
+ * @param conFlags extra flags with which the constructor symbol should be constructed
3902
+ * @param conPrivateWithin the symbol within which the constructor for this new class symbol should be private. May be noSymbol.
3903
+ * @param conParamFlags extra flags with which the constructor parameter symbols should be constructed. Must match the shape of `conMethodType`.
3904
+ *
3905
+ * Term and type parameters assigned by the constructor can be obtained via `classSymbol.memberField`/`classSymbol.memberType`.
3906
+ * This symbol starts without an accompanying definition.
3907
+ * It is the meta-programmer's responsibility to provide exactly one corresponding definition by passing
3908
+ * this symbol to the ClassDef constructor.
3909
+ *
3910
+ * @note As a macro can only splice code into the point at which it is expanded, all generated symbols must be
3911
+ * direct or indirect children of the reflection context's owner.
3912
+ */
3900
3913
@ experimental def newClass (
3901
3914
owner : Symbol ,
3902
3915
name : String ,
0 commit comments