From e79c22503ab03e2e35e3bf2c0c6de952b0022b32 Mon Sep 17 00:00:00 2001 From: Brad Fol Date: Fri, 13 Dec 2024 15:26:28 -0800 Subject: [PATCH] Fix line attachment for syntax error Previously it was placing the error on the parent `register` call rather than on the `.implements` call which was actually at issue. --- Sources/KnitCodeGen/FunctionCallRegistrationParsing.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/KnitCodeGen/FunctionCallRegistrationParsing.swift b/Sources/KnitCodeGen/FunctionCallRegistrationParsing.swift index 107b740..0e0f817 100644 --- a/Sources/KnitCodeGen/FunctionCallRegistrationParsing.swift +++ b/Sources/KnitCodeGen/FunctionCallRegistrationParsing.swift @@ -114,7 +114,10 @@ extension FunctionCallExprSyntax { functionName: .implements ) { if forwardedRegistration.hasRedundantGetter { - throw RegistrationParsingError.redundantGetter(syntax: implementsCalledMethod.calledExpression) + throw RegistrationParsingError.redundantGetter( + // Place the error on the `.implements` decl + syntax: implementsCalledMethod.calledExpression.declName + ) } forwardedRegistrations.append(forwardedRegistration) }