Symptom
A top-level (file-scope) @RenderedValue function throws ClassNotFoundException when the woven capture hook fires at runtime. Capture fails, so the value isn't recorded (and in a strict harness the test errors).
Root cause
KensaIrGenerationExtension.kt:192 computes the owner FQN passed to the hook as:
fn.parentClassOrNull?.fqNameWhenAvailable?.asString() ?: "${file.packageFqName}.${fn.name}"
For a top-level function parentClassOrNull is null, so it falls back to package.functionName — which is not a class. The runtime hook then does Class.forName(fqName) (CompilerPluginHookFunctions.kt:25) → ClassNotFoundException. The real owner is the file-facade class (<FileName>Kt).
Fix
For top-level functions, compute the file-facade class name (<FileName>Kt, honouring @JvmName) instead of package.functionName.
Top-level @RenderedValue functions currently have no test coverage.
Symptom
A top-level (file-scope)
@RenderedValuefunction throwsClassNotFoundExceptionwhen the woven capture hook fires at runtime. Capture fails, so the value isn't recorded (and in a strict harness the test errors).Root cause
KensaIrGenerationExtension.kt:192computes the owner FQN passed to the hook as:fn.parentClassOrNull?.fqNameWhenAvailable?.asString() ?: "${file.packageFqName}.${fn.name}"For a top-level function
parentClassOrNullis null, so it falls back topackage.functionName— which is not a class. The runtime hook then doesClass.forName(fqName)(CompilerPluginHookFunctions.kt:25) →ClassNotFoundException. The real owner is the file-facade class (<FileName>Kt).Fix
For top-level functions, compute the file-facade class name (
<FileName>Kt, honouring@JvmName) instead ofpackage.functionName.Top-level
@RenderedValuefunctions currently have no test coverage.