[Analysis API] add regression test on error diagnostics for functional interfaces

^KT-63432 Obsolete
This commit is contained in:
Dmitrii Gridin
2023-12-21 19:22:24 +01:00
committed by Space Team
parent 48c36ce475
commit 69a2bc9abc
6 changed files with 54 additions and 0 deletions
@@ -0,0 +1,10 @@
Diagnostics from elements:
for PSI element of type KtObjectDeclaration at (7,14-48)
ABSTRACT_MEMBER_NOT_IMPLEMENTED text ranges: [(110,116)]
PSI: KtObjectDeclaration at (7,14-48)
for PSI element of type KtConstantExpression at (10,38-39)
CONSTANT_EXPECTED_TYPE_MISMATCH text ranges: [(230,231)]
PSI: KtConstantExpression at (10,38-39)
for PSI element of type KtConstantExpression at (4,9-10)
CONSTANT_EXPECTED_TYPE_MISMATCH text ranges: [(88,89)]
PSI: KtConstantExpression at (4,9-10)
@@ -0,0 +1,16 @@
@Suppress("UNUSED_VARIABLE")
fun check() {
val o = CustomSupplier<String> {
3
}
val o2 = object : CustomSupplier<String> {}
val o3 = object : CustomSupplier<String> {
override fun get(): String = 2
}
}
fun interface CustomSupplier<T> {
fun get(): T
}
@@ -0,0 +1,10 @@
Diagnostics from elements:
for PSI element of type KtObjectDeclaration at (7,14-48)
ABSTRACT_MEMBER_NOT_IMPLEMENTED text ranges: [(110,116)]
PSI: KtObjectDeclaration at (7,14-48)
for PSI element of type KtConstantExpression at (4,9-10)
ARGUMENT_TYPE_MISMATCH text ranges: [(88,89)]
PSI: KtConstantExpression at (4,9-10)
for PSI element of type KtConstantExpression at (10,38-39)
RETURN_TYPE_MISMATCH text ranges: [(230,231)]
PSI: KtConstantExpression at (10,38-39)