Support for collections literals in LightAnnotations (KT-20543)

This commit is contained in:
Nicolay Mitropolsky
2017-10-02 13:20:06 +03:00
parent b288406e3c
commit b839081349
2 changed files with 40 additions and 1 deletions
@@ -183,7 +183,13 @@ class KtLightAnnotationForSourceEntry(
private val _initializers by lazyPub {
delegate.initializers.mapIndexed { i, it ->
wrapAnnotationValue(it, this, {
(originalExpression as KtCallElement).valueArguments[i].getArgumentExpression()!!
originalExpression.let {
when (it) {
is KtCallElement -> it.valueArguments[i].getArgumentExpression()!!
is KtCollectionLiteralExpression -> it.getInnerExpressions()[i]
else -> throw UnsupportedOperationException("cant process $it of type ${it?.javaClass}")
}
}
})
}.toTypedArray()
}