FIR body resolve: support subject type calculation

This commit is contained in:
Mikhail Glukhikh
2019-04-11 17:26:23 +03:00
parent e05dfb6541
commit 8b718c6822
15 changed files with 128 additions and 35 deletions
@@ -1,4 +1,4 @@
public final fun builder(c: R|error: createSuspendFunctionType not supported|): R|kotlin/Unit|
public final fun builder(c: R|class error: createSuspendFunctionType not supported|): R|kotlin/Unit|
public final class Controller : R|kotlin/Any| {
public final suspend fun suspendFun(): R|kotlin/Unit|
@@ -1,7 +1,8 @@
public final fun test1(): R|error: createSuspendFunctionType not supported|
public final fun test1(): R|class error: createSuspendFunctionType not supported|
public final fun test2(): R|error: createSuspendFunctionType not supported|
public final fun test2(): R|class error: createSuspendFunctionType not supported|
public final fun test3(): R|kotlin/collections/List<error: createSuspendFunctionType not supported>|
public final fun test3(): R|kotlin/collections/List<class error: createSuspendFunctionType not supported>|
public final fun test4(): R|class error: createSuspendFunctionType not supported|
public final fun test4(): R|error: createSuspendFunctionType not supported|
+6 -1
View File
@@ -1 +1,6 @@
fun foo() = if (true) 1 else 0
fun foo() = if (true) 1 else 0
fun bar(arg: Any?) = when (arg) {
is Int -> arg as Int
else -> 42
}
@@ -10,3 +10,14 @@ FILE: when.kt
}
}
public final fun bar(arg: R|kotlin/Any|?): R|kotlin/Int| {
^bar when (R|<local>/arg|) {
($subj$ is R|kotlin/Int|) -> {
(R|<local>/arg| as R|kotlin/Int|)
}
else -> {
Int(42)
}
}
}