hfhbd
10/12/2024, 10:00 PMPHondogo
10/12/2024, 10:07 PMJavier
10/13/2024, 11:56 AMpluginContext.referenceClass(classId)
?hfhbd
10/14/2024, 3:19 PMIvan Kylchik
10/15/2024, 8:35 AMgetConstAnnotationValueOrNull
.
To get an argument from IrConstructorCall
you can just call someAnnotation.getValueArgument(index)
. The same way as you do for IrCall
. But please be aware that this API will change in the nearest future.hfhbd
10/15/2024, 9:22 AMgetValueArgument
and changes are fine.
But I still want to highlight if you want to add a IrConstExpression because for (jvm) annotation values, all values must be a compile constant, including const arrays and a class reference. So IMHO getValueArgument
should not return IrExpression
but a new IrConstExpression
. (and maybe this also aligns with the const functions feature some day)Ivan Kylchik
10/15/2024, 10:55 AMIrConstExpression
node is not in out plans. As you said, we will get back to it when we start to design const functions because it is aligned.