[FIR] Update tests for previous commit
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ FILE: recursiveCallOnWhenWithSealedClass.kt
|
||||
|
||||
}
|
||||
|
||||
public final fun unwrap(): R|class error: Unresolved name: meat| {
|
||||
public final fun unwrap(): <ERROR TYPE REF: No type for block> {
|
||||
^unwrap when (this#) {
|
||||
($subj$ is R|Maybe.Nope|) -> {
|
||||
throw R|java/lang/Exception.Exception|(String())
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
fun <T> materialize(): T = throw Exception()
|
||||
|
||||
interface A
|
||||
|
||||
fun takeA(a: A) {}
|
||||
|
||||
fun test() {
|
||||
takeA(
|
||||
try {
|
||||
materialize()
|
||||
} catch (e: Exception) {
|
||||
materialize()
|
||||
} finally {
|
||||
materialize() // Should be an errror
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
FILE: tryInference.kt
|
||||
public final fun <T> materialize(): R|T| {
|
||||
^materialize throw R|java/lang/Exception.Exception|()
|
||||
}
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
}
|
||||
public final fun takeA(a: R|A|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
R|/takeA|(try {
|
||||
R|/materialize|<R|A|>()
|
||||
}
|
||||
catch (e: R|java/lang/Exception|) {
|
||||
R|/materialize|<R|A|>()
|
||||
}
|
||||
finally {
|
||||
R|/materialize|<R|kotlin/Nothing|>()
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun <T> materialize(): T = throw Exception()
|
||||
|
||||
interface A
|
||||
|
||||
fun takeA(a: A) {}
|
||||
|
||||
fun test() {
|
||||
takeA(if(true) materialize() else materialize())
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
FILE: whenInference.kt
|
||||
public final fun <T> materialize(): R|T| {
|
||||
^materialize throw R|java/lang/Exception.Exception|()
|
||||
}
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
}
|
||||
public final fun takeA(a: R|A|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
R|/takeA|(when () {
|
||||
Boolean(true) -> {
|
||||
R|/materialize|<R|A|>()
|
||||
}
|
||||
else -> {
|
||||
R|/materialize|<R|A|>()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
+10
@@ -139,6 +139,11 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
|
||||
runTest("compiler/fir/resolve/testData/resolve/treeSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryInference.kt")
|
||||
public void testTryInference() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/tryInference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("TwoDeclarationsInSameFile.kt")
|
||||
public void testTwoDeclarationsInSameFile() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/TwoDeclarationsInSameFile.kt");
|
||||
@@ -169,6 +174,11 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
|
||||
runTest("compiler/fir/resolve/testData/resolve/typeParameterVsNested.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenInference.kt")
|
||||
public void testWhenInference() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/whenInference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/fir/resolve/testData/resolve/arguments")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user