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