Skip to content

Conversation

HertzDevil
Copy link
Contributor

A lot of overloads implicitly return nil or the last expression of the def body, from Arrays and IOs to Crystal::Types and LLVM::Values, meaning more unnecessary work for the compiler, since Crystal::Visitor#visit is only called inside Crystal::ASTNode#accept and only the truthiness matters.

Most of the missing returns are for AST nodes that already have no children, so this is unlikely to affect compiler performance significantly.

@straight-shoota straight-shoota added this to the 1.12.0 milestone Jan 29, 2024
@straight-shoota straight-shoota merged commit d88c013 into crystal-lang:master Jan 30, 2024
@HertzDevil HertzDevil deleted the refactor/visitor-visit-return-type branch January 30, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants