io.github.dreamylost.macros.synchronizedMacro
Check the class and its companion object, and return the class definition.
Check the class and its companion object, and return the class definition.
Return ClassDef
Check whether the mods of the fields has a private[this]
, because it cannot be used in equals method.
Check whether the mods of the fields has a private[this]
, because it cannot be used in equals method.
Eval tree.
Eval tree.
Gets a list of generic parameters.
Gets a list of generic parameters. This is because the generic parameters of a class cannot be used directly in the return type, and need to be converted.
We generate apply method with currying, and we have to deal with the first layer of currying alone.
We generate apply method with currying, and we have to deal with the first layer of currying alone.
A apply method with currying.
apply(int: Int)(j: Int)(k: Option[String])(t: Option[Long]): B3 = new B3(int)(j)(k)(t)
Extract the methods belonging to the class, contains Secondary Constructor.
Extract the methods belonging to the class, contains Secondary Constructor.
Extract the internal fields of members belonging to the class, but not in primary constructor.
Extract the internal fields of members belonging to the class, but not in primary constructor.
We generate constructor with currying, and we have to deal with the first layer of currying alone.
We generate constructor with currying, and we have to deal with the first layer of currying alone.
A constructor with currying, it not contains tpt, provide for calling method.
TestClass12(i)(j)(k)(t)
Expand the constructor and get the field with assign.
Expand the constructor and get the field with assign.
Expand the constructor and get the field TermName.
Expand the constructor and get the field TermName.
Expand the method params and get the param Name.
Expand the method params and get the param Name.
Modify the associated object itself according to whether there is an associated object.
Modify the associated object itself according to whether there is an associated object.
The actual processing function
Return the result of modifyAction
Subclasses must override the method.
Subclasses must override the method.
Macro expanded final syntax tree.
Expand the class and check whether the class is a case class.
Expand the class and check whether the class is a case class.
classDef
Return true if it is a case class
Modify companion objects.
Modify companion objects.
Subclasses should override the method and return the final result abstract syntax tree, or an abstract syntax tree close to the final result.
Subclasses should override the method and return the final result abstract syntax tree, or an abstract syntax tree close to the final result. When the macro implementation is very simple, we don't need to use this method, so we don't need to implement it. When there are many macro input parameters, we will not use this method temporarily because we need to pass parameters.
c.Expr[Any], Why use Any? The dependent type need aux-pattern in scala2. Now let's get around this.
Output ast result.
Output ast result.
Only for primitive types, we can get type and map to scala type.
Only for primitive types, we can get type and map to scala type.
java type name
Scala type name
Wrap tree result with companion object.
Get companion object if it exists.
Get companion object if it exists.
(Since version ) see corresponding Javadoc for more information.