Make Array type parameter T non-reified

This commit is contained in:
Alexey Tsvetkov
2015-10-08 18:17:53 +03:00
parent 62c25c0370
commit 5449cea6b7
25 changed files with 62 additions and 29 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ package kotlin
* See [Kotlin language documentation](http://kotlinlang.org/docs/reference/basic-types.html#arrays)
* for more information on arrays.
*/
public class Array<reified T> private (): Cloneable {
public class Array<T> private (): Cloneable {
/**
* Returns the array element at the specified [index]. This method can be called using the
* index operator:
@@ -27,7 +27,7 @@ abstract class ReflectJavaAnnotationArgument(
return when {
value.javaClass.isEnumClassOrSpecializedEnumEntryClass() -> ReflectJavaEnumValueAnnotationArgument(name, value as Enum<*>)
value is Annotation -> ReflectJavaAnnotationAsAnnotationArgument(name, value)
value is Array<Any> -> ReflectJavaArrayAnnotationArgument(name, value)
value is Array<*> -> ReflectJavaArrayAnnotationArgument(name, value)
value is Class<*> -> ReflectJavaClassObjectAnnotationArgument(name, value)
else -> ReflectJavaLiteralAnnotationArgument(name, value)
}
@@ -42,9 +42,9 @@ class ReflectJavaLiteralAnnotationArgument(
class ReflectJavaArrayAnnotationArgument(
name: Name?,
private val values: Array<Any>
private val values: Array<*>
) : ReflectJavaAnnotationArgument(name), JavaArrayAnnotationArgument {
override fun getElements() = values.map { ReflectJavaAnnotationArgument.create(it, null) }
override fun getElements() = values.map { ReflectJavaAnnotationArgument.create(it!!, null) }
}
class ReflectJavaEnumValueAnnotationArgument(