[FE 1.0] Drop ArrayLiteralsInAnnotations feature

This feature was introduced in 1.2, so now it's stable part of language
  and we can drop support of disabling it
This commit is contained in:
Dmitriy Novozhilov
2022-01-12 11:17:28 +03:00
committed by teamcity
parent ff7eb79bb1
commit c1575edca4
19 changed files with 11 additions and 34 deletions
@@ -42,8 +42,6 @@ class CollectionLiteralResolver(
context.trace.report(UNSUPPORTED.on(collectionLiteralExpression, "Collection literals outside of annotations"))
}
checkSupportsArrayLiterals(collectionLiteralExpression, context)
return resolveCollectionLiteralSpecialMethod(collectionLiteralExpression, context)
}
@@ -81,13 +79,6 @@ class CollectionLiteralResolver(
return memberScopeOfKotlinPackage.getContributedFunctions(callName, KotlinLookupLocation(expression))
}
private fun checkSupportsArrayLiterals(expression: KtCollectionLiteralExpression, context: ExpressionTypingContext) {
if (isInsideAnnotationEntryOrClass(expression) &&
!languageVersionSettings.supportsFeature(LanguageFeature.ArrayLiteralsInAnnotations)) {
context.trace.report(UNSUPPORTED_FEATURE.on(expression, LanguageFeature.ArrayLiteralsInAnnotations to languageVersionSettings))
}
}
private fun isInsideAnnotationEntryOrClass(expression: KtCollectionLiteralExpression): Boolean {
val parent = PsiTreeUtil.getParentOfType(expression, KtAnnotationEntry::class.java, KtClass::class.java)
return parent is KtAnnotationEntry || (parent is KtClass && parent.isAnnotation())