I'm trying to generate a method in FIR that has a ...
# compiler
r
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
You could build a dumb TODO() call, or another such
Nothing
expression.
1
r
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.
j
I remember doing the
TODO()
approach