KT-1645 Propose members according to smart casts

#KT-1645 fixed
This commit is contained in:
Nikolay Krasko
2012-04-13 15:35:55 +04:00
parent 8ffca6e52f
commit 531ffaaffa
15 changed files with 147 additions and 16 deletions
@@ -0,0 +1,14 @@
trait Expr
class Num(val value : Int) : Expr
fun eval(e : Expr) {
if (e is Num) {
return e.<caret>
}
}
// EXIST: value
@@ -0,0 +1,12 @@
class Expr {}
class Num : Expr() {
fun testing() {}
}
fun eval(e : Expr) {
if (e is Num) {
return e.<caret>()
}
}
// EXIST: testing
@@ -0,0 +1,11 @@
trait Expr {
public fun testThis() {
if (this is Num) {
this.<caret>
}
}
}
class Num(val toCheck : Int) : Expr
// EXIST: toCheck
@@ -0,0 +1,8 @@
trait Expr
class Sum(val left : Expr, val right : Expr) : Expr
fun evalWhen(e : Expr) : Int = when (e) {
is Sum -> e.<caret>
}
// EXIST: left, right
@@ -0,0 +1,11 @@
class TestClass {
public fun testMethod() {
}
}
fun testFun() {
val lambda = {() -> TestClass() }
lambda().<caret>
}
// EXIST: testMethod
@@ -1,13 +1,13 @@
package something
class SomeTempClass {
fun testSome() {
fun helloWorld() {
}
fun test() {
test<caret>()
hello<caret>()
}
}
// EXIST: test, testSome
// EXIST: helloWorld