# eap

Josh Friend

09/20/2023, 7:31 PM
I know Anvil doesn't support K2 yet, but I was surprised that this error led to a `TODO()` inside kotlin that doesnt seem to have a youtrack associated:
Copy code
e: kotlin.NotImplementedError: An operation is not implemented: Missing package reporting
        at org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor.getPackage(FirModuleDescriptor.kt:35)
        at com.squareup.anvil.compiler.codegen.reference.RealAnvilModuleDescriptor.getPackage(RealAnvilModuleDescriptor.kt)
        at com.squareup.anvil.compiler.ClassScanner.findContributedClasses(ClassScanner.kt:39)
        at com.squareup.anvil.compiler.ClassScannerIrKt.findContributedClasses(ClassScannerIr.kt:23)
        at com.squareup.anvil.compiler.ModuleMergerIr.generateDaggerAnnotation(ModuleMergerIr.kt:88)
        at com.squareup.anvil.compiler.ModuleMergerIr.access$generateDaggerAnnotation(ModuleMergerIr.kt:34)
        at com.squareup.anvil.compiler.ModuleMergerIr$generate$1.visitClass(ModuleMergerIr.kt:57)

Zac Sweers

09/20/2023, 7:36 PM
That's not surprising, a lot of IR APIs reach into new FIR APIs under the hood that aren't (or won't be) fully supported
anvil won't run in IR for K2 support ultimately though so that works out

Josh Friend

09/20/2023, 7:37 PM
I didn't get this error with the last EAP, but that could be due to the other K2 blockers i reported and it just never got this far before 😄


09/20/2023, 7:42 PM
Using descriptors in IR plugins is deprecated Actually, moduleDescriptor in module fragment is the only descriptor property which is not marked with corresponding opt-in I'll replace this TODO with an exception with some proper message
👍 1