Skip to content

Conversation

@bombsimon
Copy link
Owner

@bombsimon bombsimon commented Jan 21, 2026

We only have checkExpr to recursively find ast.FuncList to check its block. We do this both recursively but also for each known node that has an expression.

Since we only care about the FuncLit it's better to just use ast.Inspect and check block for both FuncDecl and FuncLit already in Run.

This removes a lot of code and might also be faster potentially. We might get diagnostics out of order but we never guaranteed a specific order.

Closes #223

We only have `checkExpr` to recursively find `ast.FuncList` to check its
block. We do this both recursively but also for each known node that has
an expression.

Since we only care about the `FuncLit` it's better to just use
`ast.Inspect` and check block for both `FuncDecl` and `FuncLit` already
in `Run`.

This removes a lot of code and might also be faster potentially. We
might get diagnostics out of order but we never guaranteed a specific
order.
@coveralls
Copy link

Coverage Status

coverage: 94.262% (+1.7%) from 92.571%
when pulling 2f91576 on use-ast-inspect
into 6afd151 on main.

@bombsimon bombsimon merged commit 07549b2 into main Jan 21, 2026
5 checks passed
@bombsimon bombsimon deleted the use-ast-inspect branch January 21, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace checkExpr with ast.Inspect

3 participants