Skip to content

Fix scanning for static variables near start of file #274

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

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

sirbrillig
Copy link
Owner

At the start of a file, there is no previous statement, and the code which scans for static variables inside a function needs to know the position of the previous statement to determine how far back to scan. Because of the way this scan was implemented, it would throw an exception if performed at the start of a file.

This PR provides a fallback instead so that if we are at the start of a file, the scan will treat the start of the file as the previous statement position.

Fixes #271

@sirbrillig sirbrillig merged commit e0c3d7b into 2.x Aug 15, 2022
@sirbrillig sirbrillig deleted the fix-error-on-statement-find branch August 15, 2022 15:38
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.

Support of array desctructing
1 participant