I'm trying to generate a method in FIR that has a default parameter value using
createMemberFunction
. The javadocs of
valueParameter
say that if
hasDefaultValue
is true the value must be generated in IR. That's fine. But when I set it, I don't even get that far -
Fir2IrVisitor
throws because the expression for the default value is
STUB
. Is there a way around this? I can build the default value in FIR but it's rather awkward and IIUC we shouldn't be building bodies in FIR in plugins
y
Youssef Shoaib [MOD]
07/11/2025, 2:48 AM
You could build a dumb TODO() call, or another such
Nothing
expression.
➕ 1
r
rnett
07/11/2025, 3:10 AM
That's an idea, seems like it would probably work. It would probably show up in the method documentation as the default, though, which is less than ideal.