Make Array type parameter T non-reified
This commit is contained in:
@@ -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:
|
||||
|
||||
+3
-3
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user