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

Fix panic when let statement is not followed by an equal sign #174

Merged
merged 2 commits into from
Jan 11, 2023

Conversation

Mido-sys
Copy link
Contributor

What is being done in this PR?

Type in here a description of the changes in this PR.
Fix 170

What are the main choices made to get to this solution?

return stmt instead of nil to avoid using reflection in parseProgram. Also, improve parseStatement to return nil to safeguard parseProgram from panicking when trying to call String() on ast.Statement

List the manual test cases you've covered before sending this PR:

Added a new test Test_Let_Ident_NotInitialized under variables_test.go

@Mido-sys Mido-sys changed the title Fix let panic 2 Fix panic when let statement is not followed by an equal sign Jan 11, 2023
@sio4 sio4 self-assigned this Jan 11, 2023
@sio4 sio4 added the bug Something isn't working label Jan 11, 2023
@sio4 sio4 added this to the v4.1.18 milestone Jan 11, 2023
Copy link
Member

@sio4 sio4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@sio4 sio4 merged commit 0e1753a into gobuffalo:main Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Panic when let statement is not correctly used
2 participants