Takhion / kotlin-metadata

MIT License
116 stars 14 forks source link

KotlinAbstractProcessor.processingEnv leads to resolution ambiguity #9

Open ansman opened 6 years ago

ansman commented 6 years ago
screen shot 2018-05-01 at 08 11 27
Takhion commented 6 years ago

Ah yes sorry @ansman, the new version will bring a different signature for that interface!

By the way you're not required to implement the interface on the processor directly, it can be any class:


class NotAProcessor(
    override val processingEnv: ProcessingEnvironment
) : KotlinMetadataUtils {
    // ...
}
blipinsk commented 4 years ago

The processingEnv is unusable in KotlinAbstractProcessor child classes. To be able to access it you will need have to maintain a ref to it internally (and use that). Not great.

private lateinit var processingEnvironment: ProcessingEnvironment

override fun init(processingEnv: ProcessingEnvironment) {
    super.init(processingEnv)
    this.processingEnvironment = processingEnv
}