-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotation targets for qualifier annotations break kotlin-inject #447
Comments
Oh, screw this, it's related to KSP2. With KSP1 |
Disable KSP2 again as there are still subtle bugs such as: evant/kotlin-inject#447
I wonder if that makes them no longer compare equal, may be related to google/ksp#2091 |
Happy to forward this as new issue to them, but could you please point me to where qualifier annotations are resolved and how you compare them? |
Also note I put 'blocked by 3rd-party' on this but if there's a reasonable adjustment to our implementation that works I'm happy to accept it |
This almost slipped through the cracks: google/ksp#2196 |
I can get that test case to succeed with KSP2 by doing @Qualifier
@Target(
CLASS,
ANNOTATION_CLASS,
TYPE_PARAMETER,
PROPERTY,
FIELD,
LOCAL_VARIABLE,
VALUE_PARAMETER,
CONSTRUCTOR,
FUNCTION,
PROPERTY_GETTER,
PROPERTY_SETTER,
TYPE,
FILE,
TYPEALIAS,
)
annotation class QualifiedString
@Component
abstract class MainComponent {
@Provides
@QualifiedString
fun provideString(): String = ""
abstract val otherString: @QualifiedString String
} |
This looks related to something I saw in one of my projects using KSP1: @Qualifier
@Target(
PROPERTY,
PROPERTY_GETTER,
FUNCTION,
VALUE_PARAMETER,
TYPE,
)
annotation class ActivityContext
class Context
@Component
abstract class MainComponent(
@get:Provides val context: @ActivityContext Context
) {
@ActivityContext
abstract val c: Context
} If I do |
|
The following code compiles fine:
But if I add a target to the qualifier annotation, even with an exhaustive list, the code fails to compile with a confusing error.
Error:
The text was updated successfully, but these errors were encountered: