Skip to content

[KSP2] Annotation and argument's origin is wrong #2412

@acejingbo

Description

@acejingbo

For JavaLib.java is annotated with @ANNO2. When used as a lib from another src

  • KSP1: you can see KSAnnotation.origin of this @ANNO2 is JAVA_LIB
  • KSP2: you can see KSAnnotation.origin of this @ANNO2 is KOTLIN_LIB

Notice this started in KSP2 since Kotlin 2.1.0 and persist in master branch

Repro

acejingbo@0344381

  • KSP1: Run: :compiler-plugin:test and KSPCompilerPluginTest > testLibOrigins() PASSED
  • KSP2: Run :kotlin-analysis-api:test and KSPAATest > testLibOrigins() FAILED with following difference
    Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions