[Test] Migrate AbstractExtendedFirDiagnosticsTest to new infrastructure
This commit is contained in:
committed by
TeamCityServer
parent
a276d05917
commit
298e27bdac
+15
@@ -0,0 +1,15 @@
|
||||
FILE: classProperty.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final var v: R|kotlin/String?| = Null(null)
|
||||
public get(): R|kotlin/String?|
|
||||
public set(value: R|kotlin/String?|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public final fun foo(): R|kotlin/String?| {
|
||||
lval t: R|kotlin/String?| = R|/A.A|().R|/A.v|
|
||||
^foo R|<local>/t|
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
var v: String? = null
|
||||
}
|
||||
|
||||
fun foo(): String? {
|
||||
val t = A().v
|
||||
|
||||
return t
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
FILE: invoke.kt
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
lval x: R|() -> kotlin/Int| = fun <anonymous>(): R|kotlin/Int| {
|
||||
^ Int(4)
|
||||
}
|
||||
|
||||
lval y: R|() -> kotlin/Int| = fun <anonymous>(): R|kotlin/Int| {
|
||||
^ Int(2)
|
||||
}
|
||||
|
||||
^foo Int(10).R|kotlin/Int.times|(R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Int|>|()).R|kotlin/Int.plus|(R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Int|>|())
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo(): Int {
|
||||
val x = fun() = 4
|
||||
val y = fun() = 2
|
||||
return 10 * x() + y()
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
FILE: lambda.kt
|
||||
public final fun f(t: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
Int(1).R|kotlin/run|<R|kotlin/Int|, R|kotlin/Unit|>(R|<local>/t|)
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
R|/f|(<L> = f@fun <anonymous>(i: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
^@f Unit
|
||||
}
|
||||
)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun f(t: (v: Int) -> Unit) {
|
||||
1.run(t)
|
||||
}
|
||||
|
||||
fun main() {
|
||||
f { i ->
|
||||
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
FILE: localVariable.kt
|
||||
public final class Outer : R|kotlin/Any| {
|
||||
public constructor(): R|Outer| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
local final class Local : R|kotlin/Any| {
|
||||
public constructor(): R|Outer.Local| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/String| = this@R|/Outer|.R|/Outer.y|
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final val y: R|kotlin/String| = String()
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
public final fun f(): R|kotlin/Unit| {
|
||||
lval a: R|kotlin/Int| = Int(1)
|
||||
local final fun g(): R|kotlin/Int| {
|
||||
^g R|<local>/a|
|
||||
}
|
||||
|
||||
}
|
||||
public final fun foo(v: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
lval d: R|kotlin/Int|by Q|Delegate|
|
||||
lval a: R|kotlin/Int|
|
||||
lval b: R|kotlin/Int| = Int(1)
|
||||
lval c: R|kotlin/Int| = Int(2)
|
||||
@R|Anno|() lval e: R|kotlin/Int|
|
||||
R|/foo|(R|<local>/c|)
|
||||
}
|
||||
public final object Delegate : R|kotlin/Any| {
|
||||
private constructor(): R|Delegate| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final operator fun getValue(instance: R|kotlin/Any?|, property: R|kotlin/reflect/KProperty<*>|): R|kotlin/Int| {
|
||||
^getValue Int(1)
|
||||
}
|
||||
|
||||
public final operator fun setValue(instance: R|kotlin/Any?|, property: R|kotlin/reflect/KProperty<*>|, value: R|kotlin/String|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
@R|kotlin/annotation/Target|(vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.LOCAL_VARIABLE|)) public final annotation class Anno : R|kotlin/Annotation| {
|
||||
public constructor(): R|Anno| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Outer {
|
||||
fun foo() {
|
||||
class Local {
|
||||
fun bar() {
|
||||
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>x<!> = y<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val y = ""
|
||||
}
|
||||
|
||||
fun f() {
|
||||
val a = 1
|
||||
|
||||
fun g(): Int {
|
||||
return a
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun foo(v: Int) {
|
||||
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>d<!>: Int by Delegate<!>
|
||||
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>a<!>: Int<!>
|
||||
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>b<!> = 1<!>
|
||||
val c = 2
|
||||
|
||||
<!UNUSED_VARIABLE{LT}!>@Anno
|
||||
val <!UNUSED_VARIABLE{PSI}!>e<!>: Int<!>
|
||||
|
||||
foo(c)
|
||||
}
|
||||
|
||||
object Delegate {
|
||||
operator fun getValue(instance: Any?, property: KProperty<*>) = 1
|
||||
operator fun setValue(instance: Any?, property: KProperty<*>, value: String) {}
|
||||
}
|
||||
|
||||
@Target(AnnotationTarget.LOCAL_VARIABLE)
|
||||
annotation class Anno
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
FILE: manyLocalVariables.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lvar a: R|kotlin/Int| = Int(1)
|
||||
lvar b: R|kotlin/Int| = Int(2)
|
||||
lvar c: R|kotlin/Int| = Int(3)
|
||||
lval <iterator>: R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|()
|
||||
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
|
||||
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
|
||||
when () {
|
||||
==(R|<local>/a|, Int(2)) -> {
|
||||
R|<local>/b| = R|<local>/c|
|
||||
R|<local>/c| = R|<local>/a|
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b| = R|<local>/a|
|
||||
R|<local>/c| = R|<local>/b|
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
when () {
|
||||
==(R|<local>/c|, R|<local>/a|) -> {
|
||||
R|/foo|()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fun foo() {
|
||||
<!CAN_BE_VAL{LT}!><!CAN_BE_VAL{PSI}!>var<!> a = 1<!>
|
||||
var b = <!VARIABLE_INITIALIZER_IS_REDUNDANT!>2<!>
|
||||
var c = 3
|
||||
|
||||
for (i in 0..5) {
|
||||
if (a == 2) {
|
||||
<!ASSIGNED_VALUE_IS_NEVER_READ!>b<!> = c
|
||||
c = a
|
||||
} else {
|
||||
b = a
|
||||
c = b
|
||||
}
|
||||
}
|
||||
|
||||
if (c == a) {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
FILE: usedInAnnotationArguments.kt
|
||||
public final annotation class Ann : R|kotlin/Annotation| {
|
||||
public constructor(value: R|kotlin/Int|): R|Ann| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val value: R|kotlin/Int| = R|<local>/value|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
lval x: R|kotlin/Int| = Int(3)
|
||||
@R|Ann|(R|<local>/x|) lval y: R|kotlin/Int| = Int(5)
|
||||
^foo R|<local>/y|
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
annotation class Ann(val value: Int)
|
||||
|
||||
fun foo(): Int {
|
||||
val x = 3
|
||||
@Ann(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>x<!>) val y = 5
|
||||
return y
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
FILE: valueIsNeverRead.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lvar a: R|kotlin/Int| = Int(1)
|
||||
R|<local>/a| = Int(2)
|
||||
R|<local>/a| = Int(3)
|
||||
R|<local>/a| = R|<local>/a|.R|kotlin/Int.plus|(Int(1))
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
var a = <!VARIABLE_INITIALIZER_IS_REDUNDANT!>1<!>
|
||||
<!ASSIGNED_VALUE_IS_NEVER_READ!>a<!> = 2
|
||||
a = 3
|
||||
<!ASSIGNED_VALUE_IS_NEVER_READ!>a<!> += 1
|
||||
}
|
||||
Reference in New Issue
Block a user