[FIR] Replace kotlin/Throwable with java/lang/Throwable in JvmMappedScope

#KT-39044 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-06-30 12:59:42 +03:00
parent 624b9306f0
commit 648953085f
5 changed files with 17 additions and 2 deletions
@@ -0,0 +1,6 @@
// FULL_JDK
// ISSUE: KT-39044
fun test(t: Throwable) {
t.fillInStackTrace()
}
@@ -0,0 +1,4 @@
FILE: fillInStackTrace.kt
public final fun test(t: R|kotlin/Throwable|): R|kotlin/Unit| {
R|<local>/t|.R|java/lang/Throwable.fillInStackTrace|()
}
@@ -108,6 +108,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/factoryFunctionOverloads.kt");
}
@TestMetadata("fillInStackTrace.kt")
public void testFillInStackTrace() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/fillInStackTrace.kt");
}
@TestMetadata("functionAndFunctionN.kt")
public void testFunctionAndFunctionN() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/functionAndFunctionN.kt");
@@ -30,12 +30,12 @@ class JvmMappedScope(
val jvmSignature = symbol.fir.computeJvmDescriptor()
.replace("kotlin/Any", "java/lang/Object")
.replace("kotlin/String", "java/lang/String")
.replace("kotlin/Throwable", "java/lang/Throwable")
if (jvmSignature in whiteListSignatures) {
processor(symbol)
}
}
declaredMemberScope.processFunctionsByName(name, processor)
}
@@ -44,7 +44,7 @@ fun foo(x: List<String>, y: Throwable, z: A3) {
x.stream()
java.util.ArrayList<String>().stream()
y.fillInStackTrace() checkType { _<Int>() }
y.fillInStackTrace() checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Int>() }
HashMap<String, Int>().getOrDefault(Any(), null)