More precise diagnostics of smart cast impossible #KT-7240 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-11-02 17:56:31 +03:00
parent 16a8e8f6f0
commit 41ebfd025e
31 changed files with 94 additions and 73 deletions
@@ -1,14 +0,0 @@
// SUGGESTED_NAMES: i, getKm
// PARAM_TYPES: A
// PARAM_DESCRIPTOR: val a: A defined in test
class A {
}
val A.meters: Int? get() = 1
fun test() {
val a = A()
if (a.meters == null) return
val km = <selection>a.meters / 10</selection>
}
@@ -1,16 +0,0 @@
// SUGGESTED_NAMES: i, getKm
// PARAM_TYPES: A
// PARAM_DESCRIPTOR: val a: A defined in test
class A {
}
val A.meters: Int? get() = 1
fun test() {
val a = A()
if (a.meters == null) return
val km = i(a)
}
private fun i(a: A) = a.meters / 10