Show substituted type arguments for type instantiation items

This commit is contained in:
Valentin Kipyatkov
2016-03-25 14:43:22 +03:00
parent 074c6c8dcd
commit 6fa230311c
8 changed files with 46 additions and 13 deletions
@@ -1,7 +1,7 @@
class Foo<T>
class Foo<T>(t: T)
fun foo(p : Any){
var a : Foo<String> = <caret>
}
// EXIST: { lookupString:"Foo", itemText:"Foo", tailText:"() (<root>)" }
// EXIST: { lookupString:"Foo", itemText:"Foo", tailText:"(t: String) (<root>)" }
@@ -3,6 +3,8 @@ interface I<T>
abstract class C1<T> : I<T>
abstract class C2 : I<String>
abstract class C3 : I<Int>
class C4<T>(t: T) : I<T>
class C5<T1, T2>(t1: T1, t2: T2) : I<T2>
fun foo(i: I<Int>){}
@@ -13,4 +15,6 @@ fun bar() {
// EXIST: { itemText: "object: I<Int>{...}" }
// EXIST: { itemText: "object: C1<Int>(){...}" }
// EXIST: { itemText: "object: C3(){...}" }
// EXIST: { itemText: "C4", tailText: "(t: Int) (<root>)" }
// EXIST: { itemText: "C5", tailText: "(t1: T1, t2: Int) (<root>)" }
// NOTHING_ELSE
@@ -13,4 +13,4 @@ class C {
}
// EXIST: { itemText: "createProperty", typeText: "Property<C, TValue>" }
// EXIST: Property
// EXIST: { itemText: "Property", tailText: "(owner: C, value: TValue) (<root>)" }
@@ -1,16 +1,16 @@
import kotlin.reflect.KProperty
class Property<TOwner, TValue>
class Property<TOwner, TValue>(owner: TOwner, value: TValue)
operator fun <TValue, TOwner> Property<TOwner, TValue>.getValue(thisRef: TOwner, property: KProperty<*>): TValue {
throw Exception()
}
fun<TOwner, TValue> createProperty(): Property<TOwner, TValue> = Property()
fun<TOwner, TValue> createProperty(owner: TOwner, value: TValue): Property<TOwner, TValue> = Property(owner, value)
class C {
val v: Int by <caret>
}
// EXIST: { itemText: "createProperty", typeText: "Property<C, Int>" }
// EXIST: Property
// EXIST: { itemText: "Property", tailText: "(owner: C, value: Int) (<root>)" }
@@ -1,6 +1,6 @@
import kotlin.reflect.KProperty
class Property<TOwner1, TValue1>
class Property<TOwner1, TValue1>(owner: TOwner1, value: TValue1)
operator fun <TValue2, TOwner2> Property<TOwner2, TValue2>.getValue(thisRef: TOwner2, property: KProperty<*>): TValue2 {
throw Exception()
@@ -10,11 +10,11 @@ operator fun <TValue3, TOwner3> Property<TOwner3, TValue3>.setValue(thisRef: TOw
throw Exception()
}
fun<TOwner4, TValue4> createProperty(): Property<TOwner4, TValue4> = Property()
fun<TOwner4, TValue4> createProperty(owner: TOwner4, value: TValue4): Property<TOwner4, TValue4> = Property(owner, value)
class C {
var v by <caret>
}
// EXIST: { itemText: "createProperty", typeText: "Property<C, TValue4>" }
// EXIST: Property
// EXIST: { itemText: "Property", tailText: "(owner: C, value: TValue1) (<root>)" }
@@ -1,6 +1,6 @@
import kotlin.reflect.KProperty
class Property<TOwner1, TValue1>
class Property<TOwner1, TValue1>(owner: TOwner1, value: TValue1)
operator fun <TValue2, TOwner2> Property<TOwner2, TValue2>.getValue(thisRef: TOwner2, property: KProperty<*>): TValue2 {
throw Exception()
@@ -10,11 +10,11 @@ operator fun <TValue3, TOwner3> Property<TOwner3, TValue3>.setValue(thisRef: TOw
throw Exception()
}
fun<TOwner4, TValue4> createProperty(): Property<TOwner4, TValue4> = Property()
fun<TOwner4, TValue4> createProperty(owner: TOwner4, value: TValue4): Property<TOwner4, TValue4> = Property(owner, value)
class C {
var v: Int by <caret>
}
// EXIST: { itemText: "createProperty", typeText: "Property<C, Int>" }
// EXIST: Property
// EXIST: { itemText: "Property", tailText: "(owner: C, value: Int) (<root>)" }