Move optionalExpectationIncorrectUse from MPP integration to diagnostics tests
This commit is contained in:
committed by
Space Team
parent
93124ee98c
commit
dc1f1fe979
@@ -1,26 +0,0 @@
|
||||
// WITH_STDLIB
|
||||
// ADDITIONAL_COMPILER_ARGUMENTS: -opt-in=kotlin.ExperimentalMultiplatform
|
||||
|
||||
@OptionalExpectation
|
||||
expect annotation class A()
|
||||
|
||||
fun useInSignature(a: A) = a.toString()
|
||||
|
||||
@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
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
fun useInReturnType(): A? = null
|
||||
|
||||
annotation class AnotherAnnotation(val a: A)
|
||||
|
||||
@AnotherAnnotation(A())
|
||||
fun useInAnotherAnnotation() {}
|
||||
|
||||
actual class C {
|
||||
actual annotation class Nested
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
-- Common --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:7:23: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
fun useInSignature(a: A) = a.toString()
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:9:1: error: this annotation is not applicable to target 'class'
|
||||
@OptionalExpectation
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:12:1: error: '@OptionalExpectation' can only be used on an expected annotation class
|
||||
@OptionalExpectation
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:17:43: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
annotation class InOtherAnnotation(val a: A)
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:19:20: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
@InOtherAnnotation(A())
|
||||
^
|
||||
|
||||
-- JVM --
|
||||
Exit code: COMPILATION_ERROR
|
||||
Output:
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:7:23: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
fun useInSignature(a: A) = a.toString()
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:9:1: error: this annotation is not applicable to target 'class'
|
||||
@OptionalExpectation
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:10:14: error: expected class 'NotAnAnnotationClass' has no actual declaration in module <main> for JVM
|
||||
expect class NotAnAnnotationClass
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:12:1: error: '@OptionalExpectation' can only be used on an expected annotation class
|
||||
@OptionalExpectation
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:17:43: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
annotation class InOtherAnnotation(val a: A)
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/common.kt:19:20: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
@InOtherAnnotation(A())
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/jvm.kt:1:24: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
fun useInReturnType(): A? = null
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/jvm.kt:1:24: error: declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||
fun useInReturnType(): A? = null
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/jvm.kt:3:43: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
annotation class AnotherAnnotation(val a: A)
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/jvm.kt:3:43: error: declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||
annotation class AnotherAnnotation(val a: A)
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/jvm.kt:5:20: error: declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry
|
||||
@AnotherAnnotation(A())
|
||||
^
|
||||
compiler/testData/multiplatform/optionalExpectationIncorrectUse/jvm.kt:5:20: error: declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||
@AnotherAnnotation(A())
|
||||
^
|
||||
Reference in New Issue
Block a user