FIR IDE: move low level api testdata sources to the analysis directory
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
FILE: annonymousClass.kt
|
||||
public final [BODY_RESOLVE] fun x(): R|kotlin/Unit| {
|
||||
[BODY_RESOLVE] lval x: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private [BODY_RESOLVE] constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun x() {
|
||||
val x = object: Any() {
|
||||
fun foo(){}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
FILE: class.kt
|
||||
public final [BODY_RESOLVE] class B : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] fun q(): <ERROR TYPE REF: Symbol not found for C> {
|
||||
}
|
||||
|
||||
private final [BODY_RESOLVE] val y: <ERROR TYPE REF: Symbol not found for C> = this@R|/B|.R|/B.q|()
|
||||
[BODY_RESOLVE] private get(): <ERROR TYPE REF: Symbol not found for C>
|
||||
|
||||
public final [BODY_RESOLVE] fun foo([BODY_RESOLVE] a: <ERROR TYPE REF: Symbol not found for A>): <ERROR TYPE REF: Cannot infer argument for type parameter R> {
|
||||
^foo <Inapplicable(INAPPLICABLE): kotlin/with>#<R|ERROR CLASS: Cannot infer argument for type parameter T|, R|ERROR CLASS: Cannot infer argument for type parameter R|>(R|<local>/a|, <L> = [BODY_RESOLVE] with@fun <ERROR TYPE REF: Cannot infer argument for type parameter T>.<anonymous>(): <ERROR TYPE REF: Cannot infer argument for type parameter R> <inline=Unknown, kind=EXACTLY_ONCE> {
|
||||
^ <Unresolved name: bar>#(String(a), this@R|/B|.R|/B.y|)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class B {
|
||||
fun q(): C {}
|
||||
private val y = q()
|
||||
|
||||
fun foo(a: A) = with(a) {
|
||||
bar("a", y)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
FILE: constructorParameter.kt
|
||||
public final [BODY_RESOLVE] class A : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor([BODY_RESOLVE] x: R|kotlin/String|): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] val x: R|kotlin/String| = R|<local>/x|
|
||||
[BODY_RESOLVE] public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A(val x: String)
|
||||
@@ -0,0 +1,23 @@
|
||||
FILE: enum.kt
|
||||
public final [BODY_RESOLVE] enum class Enum : R|kotlin/Enum<Enum>| {
|
||||
private [BODY_RESOLVE] constructor([BODY_RESOLVE] x: R|kotlin/Int|): R|Enum| {
|
||||
super<R|kotlin/Enum<Enum>|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] val x: R|kotlin/Int| = R|<local>/x|
|
||||
[BODY_RESOLVE] public get(): R|kotlin/Int|
|
||||
|
||||
public final static [BODY_RESOLVE] enum entry A: R|Enum| = object : R|Enum| {
|
||||
private [BODY_RESOLVE] constructor(): R|<anonymous>| {
|
||||
super<R|Enum|>(Int(1))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final static [BODY_RESOLVE] fun values(): R|kotlin/Array<Enum>| {
|
||||
}
|
||||
|
||||
public final static [BODY_RESOLVE] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|Enum| {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
enum class Enum(val x: Int) {
|
||||
A(1),
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
FILE: funWithoutTypes.kt
|
||||
public final [BODY_RESOLVE] fun main(): R|kotlin/Unit| {
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main() {
|
||||
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
FILE: functionValueParameter.kt
|
||||
public final [BODY_RESOLVE] fun bar([BODY_RESOLVE] a: R|kotlin/Int|, [BODY_RESOLVE] b: R|(kotlin/Boolean) -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
}
|
||||
public final [BODY_RESOLVE] class A : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] fun foo([BODY_RESOLVE] x: R|kotlin/String|, [BODY_RESOLVE] y: R|() -> kotlin/String|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun bar(a: Int, b: (Boolean) -> Unit) {
|
||||
|
||||
}
|
||||
|
||||
class A {
|
||||
fun foo(x: String, y: () -> String) {
|
||||
|
||||
}
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
FILE: functionWithImplicitType.kt
|
||||
public final [BODY_RESOLVE] fun <T> checkSubtype([BODY_RESOLVE] t: R|T|): R|T| {
|
||||
^checkSubtype R|<local>/t|
|
||||
}
|
||||
public final [BODY_RESOLVE] val ab: R|kotlin/collections/List<kotlin/Int>?| = R|/checkSubtype|<R|kotlin/collections/List<kotlin/Int>?|>(Q|java/util/Collections|.R|java/util/Collections.emptyList|<R|ft<kotlin/Int, kotlin/Int?>|>())
|
||||
[BODY_RESOLVE] public get(): R|kotlin/collections/List<kotlin/Int>?|
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import java.util.Collections
|
||||
|
||||
fun <T> checkSubtype(t: T) = t
|
||||
|
||||
val ab = checkSubtype<List<Int>?>(Collections.emptyList<Int>())
|
||||
@@ -0,0 +1,23 @@
|
||||
FILE: lambda.kt
|
||||
public final inline [BODY_RESOLVE] fun <T, R> with([BODY_RESOLVE] receiver: R|T|, [BODY_RESOLVE] block: R|T.() -> R|): R|R| {
|
||||
^with R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|R|>|(R|<local>/receiver|)
|
||||
}
|
||||
public final inline [BODY_RESOLVE] fun <T, R> R|T|.let([BODY_RESOLVE] block: R|(T) -> R|): R|R| {
|
||||
^let R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|R|>|(this@R|/let|)
|
||||
}
|
||||
public final [BODY_RESOLVE] class B : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] fun foo([BODY_RESOLVE] a: R|kotlin/Int|): R|kotlin/String| {
|
||||
^foo R|/with|<R|kotlin/Int|, R|kotlin/String|>(R|<local>/a|, <L> = [BODY_RESOLVE] with@fun R|kotlin/Int|.<anonymous>(): R|kotlin/String| <kind=UNKNOWN> {
|
||||
^ this@R|special/anonymous|.R|kotlin/Any.toString|().R|/let|<R|kotlin/String|, R|kotlin/String|>(<L> = [BODY_RESOLVE] let@fun <anonymous>([BODY_RESOLVE] it: R|kotlin/String|): R|kotlin/String| <kind=UNKNOWN> {
|
||||
^ R|<local>/it|
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
FILE: lambdaInImplicitFunBody.kt
|
||||
public final inline [BODY_RESOLVE] fun <T, R> with([BODY_RESOLVE] receiver: R|T|, [BODY_RESOLVE] block: R|T.() -> R|): R|R| {
|
||||
^with R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|R|>|(R|<local>/receiver|)
|
||||
}
|
||||
public final inline [BODY_RESOLVE] fun <T, R> R|T|.let([BODY_RESOLVE] block: R|(T) -> R|): R|R| {
|
||||
^let R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|R|>|(this@R|/let|)
|
||||
}
|
||||
public final [BODY_RESOLVE] class B : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] fun foo([BODY_RESOLVE] a: R|kotlin/Int|): R|kotlin/String| {
|
||||
^foo R|/with|<R|kotlin/Int|, R|kotlin/String|>(R|<local>/a|, <L> = [BODY_RESOLVE] with@fun R|kotlin/Int|.<anonymous>(): R|kotlin/String| <inline=Inline, kind=UNKNOWN> {
|
||||
^ this@R|special/anonymous|.R|kotlin/Any.toString|().R|/let|<R|kotlin/String|, R|kotlin/String|>(<L> = [BODY_RESOLVE] let@fun <anonymous>([BODY_RESOLVE] it: R|kotlin/String|): R|kotlin/String| <inline=Inline, kind=UNKNOWN> {
|
||||
^ R|<local>/it|
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R {
|
||||
return receiver.block()
|
||||
}
|
||||
|
||||
inline fun <T, R> T.let(block: (T) -> R): R {
|
||||
return block(this)
|
||||
}
|
||||
|
||||
class B {
|
||||
fun foo(a: Int) = with(a) {
|
||||
toString().let { it }
|
||||
}
|
||||
}
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
FILE: lambdaInImplicitPropertyBody.kt
|
||||
public final inline [BODY_RESOLVE] fun <T, R> with([BODY_RESOLVE] receiver: R|T|, [BODY_RESOLVE] block: R|T.() -> R|): R|R| {
|
||||
^with R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|R|>|(R|<local>/receiver|)
|
||||
}
|
||||
public final inline [BODY_RESOLVE] fun <T, R> R|T|.let([BODY_RESOLVE] block: R|(T) -> R|): R|R| {
|
||||
^let R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|R|>|(this@R|/let|)
|
||||
}
|
||||
public final [BODY_RESOLVE] class B : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] val a: R|kotlin/Int| = Int(10)
|
||||
[BODY_RESOLVE] public get(): R|kotlin/Int|
|
||||
|
||||
public final [BODY_RESOLVE] val x: R|kotlin/String| = R|/with|<R|kotlin/Int|, R|kotlin/String|>(this@R|/B|.R|/B.a|, <L> = [BODY_RESOLVE] with@fun R|kotlin/Int|.<anonymous>(): R|kotlin/String| <inline=Inline, kind=UNKNOWN> {
|
||||
^ this@R|special/anonymous|.R|kotlin/Any.toString|().R|/let|<R|kotlin/String|, R|kotlin/String|>(<L> = [BODY_RESOLVE] let@fun <anonymous>([BODY_RESOLVE] it: R|kotlin/String|): R|kotlin/String| <inline=Inline, kind=UNKNOWN> {
|
||||
^ R|<local>/it|
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
[BODY_RESOLVE] public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R {
|
||||
return receiver.block()
|
||||
}
|
||||
|
||||
inline fun <T, R> T.let(block: (T) -> R): R {
|
||||
return block(this)
|
||||
}
|
||||
|
||||
class B {
|
||||
val a: Int = 10
|
||||
val x = with(a) {
|
||||
toString().let { it }
|
||||
}
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
FILE: lambdasInWithBodyFunction.kt
|
||||
public final inline [BODY_RESOLVE] fun <T, R> with([BODY_RESOLVE] receiver: R|T|, [BODY_RESOLVE] block: R|T.() -> R|): R|R| {
|
||||
^with R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|R|>|(R|<local>/receiver|)
|
||||
}
|
||||
public final inline [BODY_RESOLVE] fun <T, R> R|T|.let([BODY_RESOLVE] block: R|(T) -> R|): R|R| {
|
||||
^let R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|R|>|(this@R|/let|)
|
||||
}
|
||||
public final [BODY_RESOLVE] class A : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] fun foo(): R|kotlin/Unit| {
|
||||
[BODY_RESOLVE] lval a: R|kotlin/Int| = R|/with|<R|kotlin/Int|, R|kotlin/Int|>(Int(1), <L> = [BODY_RESOLVE] with@fun R|kotlin/Int|.<anonymous>(): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
|
||||
^ this@R|special/anonymous|.R|/let|<R|kotlin/Int|, R|kotlin/Int|>(<L> = [BODY_RESOLVE] let@fun <anonymous>([BODY_RESOLVE] it: R|kotlin/Int|): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
|
||||
^ R|<local>/it|
|
||||
}
|
||||
)
|
||||
}
|
||||
).R|/let|<R|kotlin/Int|, R|kotlin/Int|>(<L> = [BODY_RESOLVE] let@fun <anonymous>([BODY_RESOLVE] it: R|kotlin/Int|): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
|
||||
^ Int(2)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
inline fun <T, R> with(receiver: T, block: T.() -> R): R {
|
||||
return receiver.block()
|
||||
}
|
||||
|
||||
inline fun <T, R> T.let(block: (T) -> R): R {
|
||||
return block(this)
|
||||
}
|
||||
|
||||
class A {
|
||||
fun foo() {
|
||||
val a = with(1) {
|
||||
this.let { it }
|
||||
}.let { 2 }
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
FILE: localClass.kt
|
||||
public final [BODY_RESOLVE] fun x(): R|kotlin/Unit| {
|
||||
local final [BODY_RESOLVE] class Local : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor(): R|Local| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [BODY_RESOLVE] fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun x() {
|
||||
class Local {
|
||||
fun foo(){}
|
||||
}
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
FILE: propertyWithGetterAndSetter.kt
|
||||
public final [BODY_RESOLVE] var withGetterAndSetter: R|kotlin/Int| = Int(42)
|
||||
[BODY_RESOLVE] public get(): R|kotlin/Int| {
|
||||
^ F|/withGetterAndSetter|
|
||||
}
|
||||
[BODY_RESOLVE] public set([BODY_RESOLVE] value: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
F|/withGetterAndSetter| = R|<local>/value|
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
var withGetterAndSetter: Int = 42
|
||||
get() = field
|
||||
set(value) {
|
||||
field = value
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
FILE: propertyWithSetter.kt
|
||||
public abstract [BODY_RESOLVE] class Foo : R|kotlin/Any| {
|
||||
public [BODY_RESOLVE] constructor(): R|Foo| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public abstract [BODY_RESOLVE] var id: R|kotlin/Int|
|
||||
[BODY_RESOLVE] public get(): R|kotlin/Int|
|
||||
[BODY_RESOLVE] protected set([BODY_RESOLVE] value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public final [BODY_RESOLVE] class Bar : R|Foo| {
|
||||
public [BODY_RESOLVE] constructor(): R|Bar| {
|
||||
super<R|Foo|>()
|
||||
}
|
||||
|
||||
public final override [BODY_RESOLVE] var id: R|kotlin/Int| = Int(1)
|
||||
[BODY_RESOLVE] public get(): R|kotlin/Int|
|
||||
[BODY_RESOLVE] public set([BODY_RESOLVE] value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public final [BODY_RESOLVE] fun test(): R|kotlin/Unit| {
|
||||
[BODY_RESOLVE] lval bar: R|Bar| = R|/Bar.Bar|()
|
||||
R|<local>/bar|.R|/Bar.id| = Int(1)
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
abstract class Foo {
|
||||
abstract var id: Int
|
||||
protected set
|
||||
}
|
||||
|
||||
class Bar : Foo() {
|
||||
override var id: Int = 1
|
||||
<caret>public set
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val bar = Bar()
|
||||
bar.id = 1
|
||||
}
|
||||
Reference in New Issue
Block a user