@@ -3838,17 +3838,19 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3838
3838
* direct or indirect children of the reflection context's owner.
3839
3839
*/
3840
3840
// TODO: add flags and privateWithin
3841
- @ experimental def newClass (parent : Symbol , name : String , parents : List [TypeRepr ], decls : Symbol => List [Symbol ], selfType : Option [TypeRepr ]): Symbol
3841
+ @ experimental def newClass (owner : Symbol , name : String , parents : List [TypeRepr ], decls : Symbol => List [Symbol ], selfType : Option [TypeRepr ]): Symbol
3842
3842
3843
- /*
3843
+ /**
3844
+ * @param parent declerations of this class provided the symbol of this class.
3845
+ * Calling `cls.typeRef.asType` as part of this function will lead to cyclic reference errors.
3844
3846
* @param paramNames constructor parameter names.
3845
3847
* @param paramTypes constructor parameter types.
3846
3848
* @param flags extra flags with which the class symbol should be constructed.
3847
3849
* @param privateWithin the symbol within which this new method symbol should be private. May be noSymbol.
3848
3850
*
3849
3851
* Parameters can be obtained via classSymbol.memberField
3850
3852
*/
3851
- @ experimental def newClass (parent : Symbol , name : String , parents : List [TypeRepr ], decls : Symbol => List [Symbol ], selfType : Option [TypeRepr ], paramNames : List [String ], paramTypes : List [TypeRepr ], flags : Flags , privateWithin : Symbol ): Symbol
3853
+ @ experimental def newClass (owner : Symbol , name : String , parents : Symbol => List [TypeRepr ], decls : Symbol => List [Symbol ], selfType : Option [TypeRepr ], paramNames : List [String ], paramTypes : List [TypeRepr ], flags : Flags , privateWithin : Symbol ): Symbol
3852
3854
3853
3855
/** Generates a new module symbol with an associated module class symbol,
3854
3856
* this is equivalent to an `object` declaration in source code.
@@ -3865,7 +3867,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3865
3867
* def decls(cls: Symbol): List[Symbol] =
3866
3868
* List(Symbol.newMethod(cls, "run", MethodType(Nil)(_ => Nil, _ => TypeRepr.of[Unit]), Flags.EmptyFlags, Symbol.noSymbol))
3867
3869
*
3868
- * val mod = Symbol.newModule(Symbol.spliceOwner, moduleName, Flags.EmptyFlags, Flags.EmptyFlags, parents.map(_.tpe), decls, Symbol.noSymbol)
3870
+ * val mod = Symbol.newModule(Symbol.spliceOwner, moduleName, Flags.EmptyFlags, Flags.EmptyFlags, _ => parents.map(_.tpe), decls, Symbol.noSymbol)
3869
3871
* val cls = mod.moduleClass
3870
3872
* val runSym = cls.declaredMethod("run").head
3871
3873
*
@@ -3893,7 +3895,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3893
3895
* @param name The name of the class
3894
3896
* @param modFlags extra flags with which the module symbol should be constructed
3895
3897
* @param clsFlags extra flags with which the module class symbol should be constructed
3896
- * @param parents The parent classes of the class. The first parent must not be a trait.
3898
+ * @param parents A function that takes the symbol of the module class as input and returns the parent classes of the class. The first parent must not be a trait.
3897
3899
* @param decls A function that takes the symbol of the module class as input and return the symbols of its declared members
3898
3900
* @param privateWithin the symbol within which this new method symbol should be private. May be noSymbol.
3899
3901
*
@@ -3906,7 +3908,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3906
3908
*
3907
3909
* @syntax markdown
3908
3910
*/
3909
- @ experimental def newModule (owner : Symbol , name : String , modFlags : Flags , clsFlags : Flags , parents : List [TypeRepr ], decls : Symbol => List [Symbol ], privateWithin : Symbol ): Symbol
3911
+ @ experimental def newModule (owner : Symbol , name : String , modFlags : Flags , clsFlags : Flags , parents : Symbol => List [TypeRepr ], decls : Symbol => List [Symbol ], privateWithin : Symbol ): Symbol
3910
3912
3911
3913
/** Generates a new method symbol with the given parent, name and type.
3912
3914
*
0 commit comments