Extraction Engine: Support type parameter references

#KT-7260 Fixed
This commit is contained in:
Alexey Sedunov
2015-09-25 19:56:54 +03:00
parent aa080bf201
commit 78f7e6b459
10 changed files with 116 additions and 10 deletions
@@ -0,0 +1,8 @@
LineBreakpoint created at typeParameterRef.kt:13
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! typeParameterRef.TypeParameterRefPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
typeParameterRef.kt:13
Compile bytecode for foo<T>()
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,17 @@
package typeParameterRef
fun main(args: Array<String>) {
test<Int>()
}
fun foo<U>(): Int {
return 1
}
fun test<T>() {
//Breakpoint!
val a = foo<T>()
}
// EXPRESSION: foo<T>()
// RESULT: 1: I
@@ -0,0 +1,6 @@
// SUGGESTED_NAMES: i, getA
fun foo<U>() = 1
fun test<T>() {
val a = <selection>foo<T>()</selection>
}
@@ -0,0 +1,8 @@
// SUGGESTED_NAMES: i, getA
fun foo<U>() = 1
fun test<T>() {
val a = i<T>()
}
private fun <T> i() = foo<T>()
@@ -0,0 +1,8 @@
// SUGGESTED_NAMES: i, getA
// PARAM_DESCRIPTOR: value-parameter val t: T defined in test
// PARAM_TYPES: T
fun foo<U>(u: U) = 1
fun test<T>(t: T) {
val a = <selection>foo<T>(t)</selection>
}
@@ -0,0 +1,10 @@
// SUGGESTED_NAMES: i, getA
// PARAM_DESCRIPTOR: value-parameter val t: T defined in test
// PARAM_TYPES: T
fun foo<U>(u: U) = 1
fun test<T>(t: T) {
val a = i(t)
}
private fun <T> i(t: T) = foo<T>(t)