don't report unnecessary smart cast on receiver
This commit is contained in:
@@ -3,8 +3,8 @@ package d
|
||||
|
||||
fun bar(a: Any?) {
|
||||
if (a != null) {
|
||||
<!DEBUG_INFO_AUTOCAST!>a<!>.foo() //overload resolution ambiguity
|
||||
<!DEBUG_INFO_AUTOCAST!>a<!>.sure() //overload resolution ambiguity
|
||||
a.foo() //overload resolution ambiguity
|
||||
a.sure() //overload resolution ambiguity
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ fun returnFunctionLiteral(a: Any?): Function0<Int> =
|
||||
fun mergeAutocasts(a: Any?) {
|
||||
if (a is String || a is Int) {
|
||||
a.<!UNRESOLVED_REFERENCE!>compareTo<!>("")
|
||||
<!DEBUG_INFO_AUTOCAST!>a<!>.toString()
|
||||
a.toString()
|
||||
}
|
||||
if (a is Int || a is String) {
|
||||
a.<!UNRESOLVED_REFERENCE!>compareTo<!>("")
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
fun Any?.foo() {}
|
||||
|
||||
fun test(a: Any?) {
|
||||
if (a != null) {
|
||||
a.foo()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user