Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

valid_docs rule failing on throws inside a closure in a function. #451

Closed
nlutsenko opened this issue Jan 30, 2016 · 2 comments
Closed

valid_docs rule failing on throws inside a closure in a function. #451

nlutsenko opened this issue Jan 30, 2016 · 2 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@nlutsenko
Copy link

The rule is failing on a given function declaration:

public func performThings(things: (Void throws -> Result)) -> Result

From the code - it looks like we are simply doing a regex capture for the throws signature, which is technically not correct, as the documentation should be purely on the throws that preceeds the function return parameters.

According to the grammar, where optional pieces are italic - it captures the one inside parameter-clauses, but should only look at the one after all of the parameter clauses.

function-signature → parameter-clauses throws ­­_function-result­_

@jpsim jpsim added the bug Unexpected and reproducible misbehavior. label Jan 30, 2016
@jpsim
Copy link
Collaborator

jpsim commented Jan 30, 2016

yup, definitely a bug. thanks for reporting!

@jpsim
Copy link
Collaborator

jpsim commented Feb 2, 2016

Fixed in #464

@jpsim jpsim closed this as completed Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

2 participants