Special enum function support; Fix for KT-10569: Cannot iterate over values of an enum class when it is used as a generic parameter

#KT-10569 Fixed
This commit is contained in:
Michael Bogdanov
2016-11-02 12:32:47 +03:00
parent 6a3597fa0f
commit fd6d4c352c
28 changed files with 547 additions and 4 deletions
+21
View File
@@ -0,0 +1,21 @@
// FILE: 1.kt
// WITH_RUNTIME
package test
inline fun <reified T : Enum<T>> myValues(): String {
val values = enumValues<T>()
return values.joinToString("")
}
enum class Z {
O, K
}
// FILE: 2.kt
import test.*
fun box(): String {
return myValues<Z>()
}