Fix processing empty parameters (EA-124905)

This commit is contained in:
Semyon Proshev
2018-07-16 19:06:12 +03:00
parent 639541922f
commit 54bfc77c96
@@ -510,7 +510,8 @@ class PyDataclassInspection : PyInspection() {
ProblemHighlightType.LIKE_UNUSED_SYMBOL)
}
val parameters = ContainerUtil.subList(postInit.getParameters(myTypeEvalContext), 1)
val implicitParameters = postInit.getParameters(myTypeEvalContext)
val parameters = if (implicitParameters.isEmpty()) emptyList<PyCallableParameter>() else ContainerUtil.subList(implicitParameters, 1)
val message = "'$DUNDER_POST_INIT' should take all init-only variables in the same order as they are defined"
if (parameters.size != initVars.size) {