Forbid @Synchronized annotation on suspend functions
and lambdas. With warning for now. #KT-27333
This commit is contained in:
@@ -101,7 +101,12 @@ class AnnotationChecker(
|
||||
}
|
||||
|
||||
fun checkExpression(expression: KtExpression, trace: BindingTrace) {
|
||||
checkEntries(expression.getAnnotationEntries(), getActualTargetList(expression, null, trace.bindingContext), trace)
|
||||
checkEntries(
|
||||
expression.getAnnotationEntries(),
|
||||
getActualTargetList(expression, null, trace.bindingContext),
|
||||
trace,
|
||||
expression.parent as? KtAnnotated
|
||||
)
|
||||
if (expression is KtCallElement && languageVersionSettings.supportsFeature(ProperCheckAnnotationsTargetInTypeUsePositions)) {
|
||||
val typeArguments = expression.typeArguments.mapNotNull { it.typeReference }
|
||||
for (typeArgument in typeArguments) {
|
||||
|
||||
Reference in New Issue
Block a user