Is it possible to suppress errors for code to be g...
# ksp
k
Is it possible to suppress errors for code to be generated by KSP, or even better, provide IDE suggestions for same. Say I have an interface
Foo
which is annotated and is supposed generate a class
FooImpl
. Can I get hints for that beforehand or at least suppress the error while writing the using
FooImpl
?
Just read the Limitations section under KSP. Looks like it is not possible as of now
r
Instead of using class
FooImpl
directly you can use a function like
getImpl<Foo>()
. Such function can be easily generated by the KSP to return the correct implementation, but at the same time you can also declare an empty implementation of such function in your library. This way your application code will have no errors even before generating a class
FooImpl
.
k
This is super cool, thanks @Robert Jaros