From 58a0ca61a96d18d5f63dc68e2c018a2413e5a5fd Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 11 Sep 2017 13:10:09 +0300 Subject: [PATCH] Minor. Fix java test data to make it actually compilable --- .../tests/jsr305/springNullableWithTypeUse.kt | 2 +- .../tests/jsr305/springNullableWithTypeUse.txt | 2 +- .../typeEnhancement/returnTypeDifferentConstructor.kt | 10 +++++----- .../typeEnhancement/returnTypeOverrideInKotlin.kt | 3 ++- .../typeEnhancement/returnTypeOverrideInKotlin.txt | 2 +- .../tests/typeEnhancement/simple.kt | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/compiler/testData/foreignAnnotationsJava8/tests/jsr305/springNullableWithTypeUse.kt b/compiler/testData/foreignAnnotationsJava8/tests/jsr305/springNullableWithTypeUse.kt index 152dd1d2189..b6053f12fd8 100644 --- a/compiler/testData/foreignAnnotationsJava8/tests/jsr305/springNullableWithTypeUse.kt +++ b/compiler/testData/foreignAnnotationsJava8/tests/jsr305/springNullableWithTypeUse.kt @@ -33,7 +33,7 @@ import java.lang.annotation.Target; import javax.annotation.Nonnull; import javax.annotation.meta.TypeQualifierDefault; -@Target(ElementType.CLASS) +@Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Nonnull diff --git a/compiler/testData/foreignAnnotationsJava8/tests/jsr305/springNullableWithTypeUse.txt b/compiler/testData/foreignAnnotationsJava8/tests/jsr305/springNullableWithTypeUse.txt index e81d4f28c39..3721c8d8cdc 100644 --- a/compiler/testData/foreignAnnotationsJava8/tests/jsr305/springNullableWithTypeUse.txt +++ b/compiler/testData/foreignAnnotationsJava8/tests/jsr305/springNullableWithTypeUse.txt @@ -15,7 +15,7 @@ public fun main(/*0*/ a: A): kotlin.Unit package spr { - @kotlin.annotation.Target(allowedTargets = {}) @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) @kotlin.annotation.MustBeDocumented @javax.annotation.Nonnull @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.TYPE_USE}) public final annotation class NonNullApi : kotlin.Annotation { + @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FILE}) @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) @kotlin.annotation.MustBeDocumented @javax.annotation.Nonnull @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.TYPE_USE}) public final annotation class NonNullApi : kotlin.Annotation { public constructor NonNullApi() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeDifferentConstructor.kt b/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeDifferentConstructor.kt index a590777d855..0ba8da1dd1e 100644 --- a/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeDifferentConstructor.kt +++ b/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeDifferentConstructor.kt @@ -13,26 +13,26 @@ class Outer { class B extends A { @Override - Base foo() {} + Base foo() { return null; } } class C extends A { @Override - @NonNull Base foo() {} + @NonNull Base foo() { return null; } } class D extends A { @Override - Derived foo() {} + Derived foo() { return null; } } class E extends A { @Override - @NonNull Derived foo() {} + @NonNull Derived foo() { return null; } } class F extends A { @Override - @NonNull Derived<@NonNull String> foo() {} + @NonNull Derived<@NonNull String> foo() { return null; } } } diff --git a/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeOverrideInKotlin.kt b/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeOverrideInKotlin.kt index ae567c9733d..adb2de504d5 100644 --- a/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeOverrideInKotlin.kt +++ b/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeOverrideInKotlin.kt @@ -1,3 +1,5 @@ +// FILE: Base.java +public interface Base {} // FILE: A.java import org.checkerframework.checker.nullness.qual.*; @@ -8,7 +10,6 @@ public class A { // FILE: a.kt -interface Base {} interface Derived : Base {} fun bar1(): Derived = null!! diff --git a/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeOverrideInKotlin.txt b/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeOverrideInKotlin.txt index eb9e30f2cc0..bedd264fb31 100644 --- a/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeOverrideInKotlin.txt +++ b/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/returnTypeOverrideInKotlin.txt @@ -19,7 +19,7 @@ public final class B : A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public interface Base { +public interface Base { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/simple.kt b/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/simple.kt index 46bded8f1d4..4b52e7f51b2 100644 --- a/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/simple.kt +++ b/compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/simple.kt @@ -4,5 +4,5 @@ import org.checkerframework.checker.nullness.qual.*; import java.util.*; class A { - List<@NonNull String> foo() {} + List<@NonNull String> foo() { return null; } }