KT-4915 Smart completion should work for auto-casted 'this'

#KT-4915 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-08-04 22:08:23 +03:00
parent 44d277af87
commit 2b61f4c552
11 changed files with 129 additions and 100 deletions
@@ -1,12 +0,0 @@
open class Foo{
fun f() {
if (this is Bar){
var a : Bar = <caret>
}
}
}
class Bar : Foo
// EXIST: { itemText:"this" }
@@ -0,0 +1,13 @@
open class Foo{
fun Any.f() {
if (this@Foo is Bar && this is Bar){
var a: Bar = <caret>
}
}
}
class Bar : Foo
// EXIST: { lookupString: "this" }
// EXIST: { lookupString: "this@Foo" }
@@ -0,0 +1,16 @@
open class Foo{
fun Bar.f() {
fun Any.g() {
if (this is Bar){
var a: Bar = this@<caret>
}
}
}
}
class Bar : Foo
// EXIST: { lookupString: "this@g" }
// EXIST: { lookupString: "this@f" }
// ABSENT: { lookupString: "this@Foo" }