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
This commit is contained in:
committed by
teamcityserver
parent
7eb758fab1
commit
85e6c90052
+1
-1
@@ -39,7 +39,7 @@ class Context<T>
|
||||
fun <T> Any.decodeIn(typeFrom: Context<in T>): T = something()
|
||||
|
||||
fun <T> Any?.decodeOut1(typeFrom: Context<out T>): T {
|
||||
return <!RETURN_TYPE_MISMATCH!>this?.decodeIn(typeFrom) ?: kotlin.Unit<!>
|
||||
return this?.decodeIn(typeFrom) ?: kotlin.Unit
|
||||
}
|
||||
|
||||
fun <T> Any.decodeOut2(typeFrom: Context<out T>): T {
|
||||
|
||||
+2
-2
@@ -20,9 +20,9 @@ fun test1(): Int {
|
||||
}
|
||||
|
||||
fun test2(): Int {
|
||||
val x: String = <!INITIALIZER_TYPE_MISMATCH!>when {
|
||||
val x: String = when {
|
||||
true -> Any()
|
||||
else -> null
|
||||
} ?: return 0<!>
|
||||
} ?: return 0
|
||||
return x.hashCode()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user