diff --git a/plugins/annotation-processing/src/org/jetbrains/kotlin/annotation/processing/impl/KotlinTypes.kt b/plugins/annotation-processing/src/org/jetbrains/kotlin/annotation/processing/impl/KotlinTypes.kt index b7e666be10b..3873e63d278 100644 --- a/plugins/annotation-processing/src/org/jetbrains/kotlin/annotation/processing/impl/KotlinTypes.kt +++ b/plugins/annotation-processing/src/org/jetbrains/kotlin/annotation/processing/impl/KotlinTypes.kt @@ -266,5 +266,7 @@ private fun assertKindNot(typeMirror: TypeMirror, vararg kinds: TypeKind): Unit } private fun assertJeType(type: TypeMirror) { - illegalArg("Must be a subclass of JePsiType, got ${type.javaClass.name}") + if (type !is JeTypeMirror) { + illegalArg("Must be a subclass of JePsiType, got ${type.javaClass.name}") + } } \ No newline at end of file diff --git a/plugins/plugins-tests/tests/org/jetbrains/kotlin/annotation/processing/test/processor/ElementsTests.kt b/plugins/plugins-tests/tests/org/jetbrains/kotlin/annotation/processing/test/processor/ElementsTests.kt index bb91074e813..8b4ce228209 100644 --- a/plugins/plugins-tests/tests/org/jetbrains/kotlin/annotation/processing/test/processor/ElementsTests.kt +++ b/plugins/plugins-tests/tests/org/jetbrains/kotlin/annotation/processing/test/processor/ElementsTests.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.annotation.processing.test.processor import org.jetbrains.kotlin.annotation.processing.impl.KotlinElements import org.jetbrains.kotlin.java.model.elements.JeTypeElement +import org.jetbrains.kotlin.java.model.types.JeArrayType import javax.lang.model.element.ExecutableElement import javax.lang.model.element.TypeElement @@ -128,4 +129,10 @@ class ElementsTests : AbstractProcessorTest() { val classes = packageElement.enclosedElements.filterIsInstance() assertEquals(2, classes.size) } + + fun testGetArrayType() = test("GetPackageOf", "*") { set, roundEnv, env -> + val myClass = env.findClass("test.MyClass").asType() + val array = env.typeUtils.getArrayType(myClass) + assert(array is JeArrayType) + } } \ No newline at end of file