Minor: add / fix comments (related to KT-20752)

This commit is contained in:
Mikhail Glukhikh
2017-10-16 20:00:47 +03:00
parent 46526db8f0
commit 3fb0354676
3 changed files with 6 additions and 4 deletions
@@ -97,6 +97,8 @@ internal class DelegatingDataFlowInfo private constructor(
languageVersionSettings: LanguageVersionSettings,
typeInfo: SetMultimap<DataFlowValue, KotlinType>? = null,
affectReceiver: Boolean = true,
// TODO: remove me in version 1.3! I'm very dirty hack!
// In normal circumstances this should be always true
recordUnstable: Boolean = true
): Boolean {
if (value.isStable || recordUnstable) {
@@ -14,12 +14,12 @@ fun StringList.remove(s: String?) = s ?: ""
fun foo(list: StringList, arg: Unstable) {
list.remove(arg.first)
if (arg.first <!USELESS_CAST!>as? String<!> != null) {
// Ideally should have smart cast impossible here
// Should be still resolved to extension, without smart cast or smart cast impossible
list.remove(arg.first)
}
val s = arg.first <!USELESS_CAST!>as? String<!>
if (s != null) {
// Ideally should have smart cast impossible here
// Should be still resolved to extension, without smart cast or smart cast impossible
list.remove(arg.first)
}
}
@@ -16,7 +16,7 @@ fun String.isEmpty() = this == ""
fun foo(list: StringList, arg: Unstable) {
list.remove(arg.first)
if (arg.first?.isEmpty() ?: false) {
// Ideally should have smart cast impossible here
// Should be still resolved to extension, without smart cast or smart cast impossible
list.remove(<!SMARTCAST_IMPOSSIBLE!>arg.first<!>)
}
}
@@ -34,7 +34,7 @@ fun BooleanList.remove(b: Boolean?) = b ?: false
fun bar(list: BooleanList, arg: UnstableBoolean) {
list.remove(arg.first)
if (arg.first ?: false) {
// Ideally should have smart cast impossible here
// Should be still resolved to extension, without smart cast or smart cast impossible
list.remove(<!SMARTCAST_IMPOSSIBLE!>arg.first<!>)
}
}