From 85e6c90052d9ab13f660638c4987f159e9e02454 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Wed, 24 Nov 2021 15:25:17 +0300 Subject: [PATCH] FIR: Temporary adjust diagnostic tests Elvis now is being resolved a bit differently and in case of inconsistent types, the while expression has error type, but no diagnostic is reported since the element has no valid source element When one sets the source https://github.com/JetBrains/kotlin/commit/817316cdc93457c1de7cf10c3b422e3a4b486e5b it brings back the issue KT-45989 that was effectively unresolved but hidden due to diagnostic loss ^KT-45989 Open --- .../typeParameters/implicitNothingInReturnPosition.fir.kt | 2 +- compiler/testData/diagnostics/tests/when/kt9972.fir.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/testData/diagnostics/tests/typeParameters/implicitNothingInReturnPosition.fir.kt b/compiler/testData/diagnostics/tests/typeParameters/implicitNothingInReturnPosition.fir.kt index d7962a6e56e..ebe07df208b 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/implicitNothingInReturnPosition.fir.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/implicitNothingInReturnPosition.fir.kt @@ -39,7 +39,7 @@ class Context fun Any.decodeIn(typeFrom: Context): T = something() fun Any?.decodeOut1(typeFrom: Context): T { - return this?.decodeIn(typeFrom) ?: kotlin.Unit + return this?.decodeIn(typeFrom) ?: kotlin.Unit } fun Any.decodeOut2(typeFrom: Context): T { diff --git a/compiler/testData/diagnostics/tests/when/kt9972.fir.kt b/compiler/testData/diagnostics/tests/when/kt9972.fir.kt index 12843090fd3..c603b5ede70 100644 --- a/compiler/testData/diagnostics/tests/when/kt9972.fir.kt +++ b/compiler/testData/diagnostics/tests/when/kt9972.fir.kt @@ -20,9 +20,9 @@ fun test1(): Int { } fun test2(): Int { - val x: String = when { + val x: String = when { true -> Any() else -> null - } ?: return 0 + } ?: return 0 return x.hashCode() }