Skip to content

Commit

Permalink
Fix line attachment for syntax error
Browse files Browse the repository at this point in the history
Previously it was placing the error on the parent `register` call rather than on the `.implements` call which was actually at issue.
  • Loading branch information
bradfol committed Dec 13, 2024
1 parent eb127c6 commit e79c225
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/KnitCodeGen/FunctionCallRegistrationParsing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit e79c225

Please sign in to comment.