Allow to use collection literals only in annotations
This commit is contained in:
+4
@@ -1517,6 +1517,10 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
public KotlinTypeInfo visitCollectionLiteralExpression(
|
||||
@NotNull KtCollectionLiteralExpression expression, ExpressionTypingContext context
|
||||
) {
|
||||
if (!isInsideAnnotationEntryOrClass(expression)) {
|
||||
context.trace.report(UNSUPPORTED.on(expression, "Collection literals outside of annotations"));
|
||||
}
|
||||
|
||||
checkSupportsArrayLiterals(expression, context);
|
||||
return resolveCollectionLiteralSpecialMethod(expression, context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user