[FIR-TEST] Move analysis tests to separate module

This commit is contained in:
Dmitriy Novozhilov
2020-03-18 15:10:46 +03:00
parent 3a479d5d16
commit cc07ae96b3
1477 changed files with 1001 additions and 980 deletions
@@ -0,0 +1,8 @@
fun <T> id(t: T) = t
fun main() {
val a = id("string")
val b = id(null)
val c = id(id(a))
}
@@ -0,0 +1,9 @@
FILE: id.kt
public final fun <T> id(t: R|T|): R|T| {
^id R|<local>/t|
}
public final fun main(): R|kotlin/Unit| {
lval a: R|kotlin/String| = R|/id|<R|kotlin/String|>(String(string))
lval b: R|kotlin/Nothing?| = R|/id|<R|kotlin/Nothing?|>(Null(null))
lval c: R|kotlin/String| = R|/id|<R|kotlin/String|>(R|/id|<R|kotlin/String|>(R|<local>/a|))
}
@@ -0,0 +1,11 @@
interface Foo
class FooImpl : Foo
class Bar
fun <T : Foo> foo(t: T) = t
fun main(fooImpl: FooImpl, bar: Bar) {
val a = foo(fooImpl)
val b = <!INAPPLICABLE_CANDIDATE!>foo<!>(bar)
}
@@ -0,0 +1,22 @@
FILE: typeParameters.kt
public abstract interface Foo : R|kotlin/Any| {
}
public final class FooImpl : R|Foo| {
public constructor(): R|FooImpl| {
super<R|kotlin/Any|>()
}
}
public final class Bar : R|kotlin/Any| {
public constructor(): R|Bar| {
super<R|kotlin/Any|>()
}
}
public final fun <T : R|Foo|> foo(t: R|T|): R|T| {
^foo R|<local>/t|
}
public final fun main(fooImpl: R|FooImpl|, bar: R|Bar|): R|kotlin/Unit| {
lval a: R|FooImpl| = R|/foo|<R|FooImpl|>(R|<local>/fooImpl|)
lval b: <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [/foo]> = <Inapplicable(INAPPLICABLE): [/foo]>#(R|<local>/bar|)
}
@@ -0,0 +1,11 @@
interface Foo
class FooImpl : Foo
class FooBarImpl : Foo
fun <T : Foo> foo(t: T) = t
fun main(fooImpl: FooImpl, fooBarImpl: FooBarImpl) {
val a = <!INAPPLICABLE_CANDIDATE!>foo<!><FooImpl>(fooBarImpl)
val b = foo<Foo>(fooImpl)
}
@@ -0,0 +1,22 @@
FILE: typeParameters2.kt
public abstract interface Foo : R|kotlin/Any| {
}
public final class FooImpl : R|Foo| {
public constructor(): R|FooImpl| {
super<R|kotlin/Any|>()
}
}
public final class FooBarImpl : R|Foo| {
public constructor(): R|FooBarImpl| {
super<R|kotlin/Any|>()
}
}
public final fun <T : R|Foo|> foo(t: R|T|): R|T| {
^foo R|<local>/t|
}
public final fun main(fooImpl: R|FooImpl|, fooBarImpl: R|FooBarImpl|): R|kotlin/Unit| {
lval a: <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [/foo]> = <Inapplicable(INAPPLICABLE): [/foo]>#<R|FooImpl|>(R|<local>/fooBarImpl|)
lval b: R|Foo| = R|/foo|<R|Foo|>(R|<local>/fooImpl|)
}