Hi, I'm trying to create a synthetic property for ...
# compiler
k
Hi, I'm trying to create a synthetic property for a specific class - I just started learning the compiler a few hours ago! For now, I'm fine with it applying to all classes - I'm just trying to get it working! Right now, I created a
SyntheticResolveExtension
that seems to create a synthetic property named
test
that works on any
Any
and returns a
String
. However, compilation still fails because the property getter has no function body:
Copy code
Caused by: java.lang.IllegalStateException: Function has no body: FUN name:<get-test> visibility:public modality:OPEN <testDescriptor> ($receiver:kotlin.Any) returnType:kotlin.String
Is the next step to add a function body to this property with an
IrElementVisitor
? Or is that wrong / is there a better method?