Improve diagnostics for unrecognized InvocationKind in contracts
This commit is contained in:
committed by
Ilya Gorbunov
parent
e40f11ec52
commit
ca20c0b0bd
+8
-2
@@ -46,8 +46,14 @@ internal class PsiCallsEffectParser(
|
|||||||
|
|
||||||
val kind = when (kindArgument) {
|
val kind = when (kindArgument) {
|
||||||
is DefaultValueArgument -> InvocationKind.UNKNOWN
|
is DefaultValueArgument -> InvocationKind.UNKNOWN
|
||||||
is ExpressionValueArgument -> kindArgument.valueArgument?.getArgumentExpression()?.toInvocationKind(callContext.bindingContext) ?: return null
|
is ExpressionValueArgument -> kindArgument.valueArgument?.getArgumentExpression()?.toInvocationKind(callContext.bindingContext)
|
||||||
else -> return null
|
else -> null
|
||||||
|
}
|
||||||
|
|
||||||
|
if (kind == null) {
|
||||||
|
val reportOn = (kindArgument as? ExpressionValueArgument)?.valueArgument?.getArgumentExpression() ?: expression
|
||||||
|
collector.badDescription("unrecognized InvocationKind", reportOn)
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return CallsEffectDeclaration(lambda, kind)
|
return CallsEffectDeclaration(lambda, kind)
|
||||||
|
|||||||
Reference in New Issue
Block a user