diff --git a/src/language/validation/other/argumentLists.ts b/src/language/validation/other/argumentLists.ts index 6d7dc5dce..0d133dc4a 100644 --- a/src/language/validation/other/argumentLists.ts +++ b/src/language/validation/other/argumentLists.ts @@ -104,9 +104,13 @@ export const argumentListMustSetAllRequiredParameters = (services: SafeDsService const nodeMapper = services.helpers.NodeMapper; return (node: SdsAbstractCall, accept: ValidationAcceptor): void => { - const callable = nodeMapper.callToCallableOrUndefined(node); + // We already report other errors in this case + if (!node.argumentList) { + return; + } // We already report other errors in those cases + const callable = nodeMapper.callToCallableOrUndefined(node); if (!callable || (isSdsCall(node) && isSdsAnnotation(callable))) { return; } diff --git a/tests/resources/validation/other/argument lists/missing required parameter/dont show this error if the argument list is missing altogether.sdstest b/tests/resources/validation/other/argument lists/missing required parameter/dont show this error if the argument list is missing altogether.sdstest new file mode 100644 index 000000000..54c273283 --- /dev/null +++ b/tests/resources/validation/other/argument lists/missing required parameter/dont show this error if the argument list is missing altogether.sdstest @@ -0,0 +1,21 @@ +package tests.validation.other.argumentLists.missingRequiredParameter + +// $TEST$ no error r"The parameters? .* must be set here\." + +@MyAnnotation +segment mySegment2( + myCallableType: (a: Int, b: Int, c: Int = 0) -> () +) { + val myBlockLambda = (a: Int, b: Int, c: Int = 0) {}; + val myExpressionLambda = (a: Int, b: Int, c: Int = 0) -> 1; + + MyAnnotation; + MyClass; + MyEnum.MyEnumVariant; + myFunction; + mySegment1; + myCallableType; + myBlockLambda; + myExpressionLambda; + myPipeline; +}