Move optionalExpectationIncorrectUse from MPP integration to diagnostics tests
This commit is contained in:
committed by
Space Team
parent
93124ee98c
commit
dc1f1fe979
+41
@@ -0,0 +1,41 @@
|
||||
// WITH_STDLIB
|
||||
// !OPT_IN: kotlin.ExperimentalMultiplatform
|
||||
|
||||
// MODULE: common
|
||||
// TARGET_PLATFORM: Common
|
||||
// FILE: common.kt
|
||||
|
||||
@OptionalExpectation
|
||||
expect annotation class A()
|
||||
|
||||
fun useInSignature(a: A) = a.toString()
|
||||
|
||||
<!NO_ACTUAL_FOR_EXPECT{JVM}!><!WRONG_ANNOTATION_TARGET!>@OptionalExpectation<!>
|
||||
expect class NotAnAnnotationClass<!>
|
||||
|
||||
@OptionalExpectation
|
||||
annotation class NotAnExpectedClass
|
||||
|
||||
annotation class InOtherAnnotation(val a: A)
|
||||
|
||||
@InOtherAnnotation(A())
|
||||
fun useInOtherAnnotation() {}
|
||||
|
||||
expect class C {
|
||||
@OptionalExpectation
|
||||
annotation class Nested
|
||||
}
|
||||
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
fun useInReturnType(): A? = null
|
||||
|
||||
annotation class AnotherAnnotation(val a: A)
|
||||
|
||||
@AnotherAnnotation(A())
|
||||
fun useInAnotherAnnotation() {}
|
||||
|
||||
actual class C {
|
||||
actual annotation class Nested
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
// WITH_STDLIB
|
||||
// !OPT_IN: kotlin.ExperimentalMultiplatform
|
||||
|
||||
// MODULE: common
|
||||
// TARGET_PLATFORM: Common
|
||||
// FILE: common.kt
|
||||
|
||||
@OptionalExpectation
|
||||
expect annotation class A()
|
||||
|
||||
fun useInSignature(a: <!OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY, OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY{JVM}!>A<!>) = a.toString()
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET, WRONG_ANNOTATION_TARGET{JVM}!>@OptionalExpectation<!>
|
||||
expect class <!NO_ACTUAL_FOR_EXPECT{JVM}!>NotAnAnnotationClass<!>
|
||||
|
||||
<!OPTIONAL_EXPECTATION_NOT_ON_EXPECTED, OPTIONAL_EXPECTATION_NOT_ON_EXPECTED{JVM}!>@OptionalExpectation<!>
|
||||
annotation class NotAnExpectedClass
|
||||
|
||||
annotation class InOtherAnnotation(val a: <!OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY, OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY{JVM}!>A<!>)
|
||||
|
||||
@InOtherAnnotation(<!OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY, OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY{JVM}!>A<!>())
|
||||
fun useInOtherAnnotation() {}
|
||||
|
||||
expect class C {
|
||||
@OptionalExpectation
|
||||
annotation class Nested
|
||||
}
|
||||
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
fun useInReturnType(): <!OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY, OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE!>A<!>? = null
|
||||
|
||||
annotation class AnotherAnnotation(val a: <!OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY, OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE!>A<!>)
|
||||
|
||||
@AnotherAnnotation(<!OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY, OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE!>A<!>())
|
||||
fun useInAnotherAnnotation() {}
|
||||
|
||||
actual class C {
|
||||
actual annotation class Nested
|
||||
}
|
||||
Reference in New Issue
Block a user