FIR: Mark a pack of tests (53) as FIR_IDENTICAL
This commit is contained in:
committed by
teamcityserver
parent
ddbdfafa79
commit
dac9d7b17a
@@ -1,40 +0,0 @@
|
||||
// !LANGUAGE: +BooleanElvisBoundSmartCasts
|
||||
// See KT-20752
|
||||
|
||||
class Unstable {
|
||||
val first: String? get() = null
|
||||
}
|
||||
|
||||
class StringList {
|
||||
fun remove(s: String) = s
|
||||
}
|
||||
|
||||
fun StringList.remove(s: String?) = s ?: ""
|
||||
|
||||
fun String.isEmpty() = this == ""
|
||||
|
||||
fun foo(list: StringList, arg: Unstable) {
|
||||
list.remove(arg.first)
|
||||
if (arg.first?.isEmpty() ?: false) {
|
||||
// Should be still resolved to extension, without smart cast or smart cast impossible
|
||||
list.remove(arg.first)
|
||||
}
|
||||
}
|
||||
|
||||
class UnstableBoolean {
|
||||
val first: Boolean? get() = null
|
||||
}
|
||||
|
||||
class BooleanList {
|
||||
fun remove(b: Boolean) = b
|
||||
}
|
||||
|
||||
fun BooleanList.remove(b: Boolean?) = b ?: false
|
||||
|
||||
fun bar(list: BooleanList, arg: UnstableBoolean) {
|
||||
list.remove(arg.first)
|
||||
if (arg.first ?: false) {
|
||||
// Should be still resolved to extension, without smart cast or smart cast impossible
|
||||
list.remove(arg.first)
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +BooleanElvisBoundSmartCasts
|
||||
// See KT-20752
|
||||
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
fun foo() {
|
||||
var v: String? = "xyz"
|
||||
// It is possible in principle to provide smart cast here
|
||||
v<!UNSAFE_CALL!>.<!>length
|
||||
v = null
|
||||
v<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
fun foo() {
|
||||
var v: String? = "xyz"
|
||||
// It is possible in principle to provide smart cast here
|
||||
|
||||
Reference in New Issue
Block a user