7e43000d9b
The change in signatureEnhancement.kt in 432f581cb2 was incorrect. Contrary to its name, the removed method `hasDefaultValueInAnnotation` checked not only if the enhancement annotation has default value (which is what the removed feature was about), but also if the parameter itself declares default value. This was mistakenly substituted by just `false` on line 234. The correct change is to use the `declaresDefaultValue` flag of the original parameter. It's kind of weird though that in case there's a nullability annotation on the whole package (like in KT-48316) type enhancement is being done on everything, including annotation constructors, whose parameter types can't have any enhancement information. Maybe this should be improved independently. #KT-48316 Fixed
35 lines
558 B
Kotlin
Vendored
35 lines
558 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
// FILE: lib/NonNullApi.java
|
|
|
|
package lib;
|
|
|
|
import java.lang.annotation.*;
|
|
import javax.annotation.Nonnull;
|
|
import javax.annotation.meta.TypeQualifierDefault;
|
|
|
|
@Target(ElementType.PACKAGE)
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
@Nonnull
|
|
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
|
|
public @interface NonNullApi {}
|
|
|
|
// FILE: lib/package-info.java
|
|
|
|
@NonNullApi
|
|
package lib;
|
|
|
|
// FILE: lib/A.java
|
|
|
|
package lib;
|
|
|
|
public @interface A {
|
|
Class value() default String.class;
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
import lib.A
|
|
|
|
@A
|
|
fun test() {}
|