[FIR] Support several annotation class diagnostics

This commit is contained in:
Likholetov Mikhail
2020-04-30 00:12:39 +03:00
committed by Mikhail Glukhikh
parent 1e8dff6a7c
commit aa706d322d
21 changed files with 206 additions and 48 deletions
@@ -0,0 +1,7 @@
annotation class A() {
<!ANNOTATION_CLASS_MEMBER!>constructor(s: Nothing?) {}<!>
<!ANNOTATION_CLASS_MEMBER!>init {}<!>
<!ANNOTATION_CLASS_MEMBER!>fun foo() {}<!>
<!ANNOTATION_CLASS_MEMBER!>val bar: Nothing?<!>
<!ANNOTATION_CLASS_MEMBER!>val baz get() = Unit<!>
}
@@ -0,0 +1,25 @@
FILE: annotationClassMember.kt
public final annotation class A : R|kotlin/Annotation| {
public constructor(): R|A| {
super<R|kotlin/Any|>()
}
public constructor(s: R|kotlin/Nothing?|): R|A| {
this<R|A|>()
}
init {
}
public final fun foo(): R|kotlin/Unit| {
}
public final val bar: R|kotlin/Nothing?|
public get(): R|kotlin/Nothing?|
public final val baz: R|kotlin/Unit|
public get(): R|kotlin/Unit| {
^ Q|kotlin/Unit|
}
}
@@ -0,0 +1,8 @@
fun foo() {
<!LOCAL_ANNOTATION_CLASS_ERROR!>annotation class Ann<!>
@Anno class Local {
// There should also be NESTED_CLASS_NOT_ALLOWED report here.
<!LOCAL_ANNOTATION_CLASS_ERROR!>annotation class Nested<!>
}
}
@@ -0,0 +1,24 @@
FILE: localAnnotationClass.kt
public final fun foo(): R|kotlin/Unit| {
local final annotation class Ann : R|kotlin/Annotation| {
public[local] constructor(): R|Ann| {
super<R|kotlin/Any|>()
}
}
@R|ERROR CLASS: Symbol not found, for `Anno`|() local final class Local : R|kotlin/Any| {
public[local] constructor(): R|Local| {
super<R|kotlin/Any|>()
}
local final annotation class Nested : R|kotlin/Annotation| {
public[local] constructor(): R|Local.Nested| {
super<R|kotlin/Any|>()
}
}
}
}
@@ -0,0 +1,4 @@
annotation class A(
<!VAR_ANNOTATION_PARAMETER!>var<!> a: Int,
<!MISSING_VAL_ON_ANNOTATION_PARAMETER!>b: String<!>
)
@@ -0,0 +1,11 @@
FILE: valOnAnnotationParameter.kt
public final annotation class A : R|kotlin/Annotation| {
public constructor(a: R|kotlin/Int|, b: R|kotlin/String|): R|A| {
super<R|kotlin/Any|>()
}
public final var a: R|kotlin/Int| = R|<local>/a|
public get(): R|kotlin/Int|
public set(value: R|kotlin/Int|): R|kotlin/Unit|
}