-
Notifications
You must be signed in to change notification settings - Fork 43
Define ParserContext as ref struct #259
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 It seemed to me that I once tried to do this. Do you have a practical scenario when it is required? Let's add ref to LexerContext
too.
Co-authored-by: Ivan Maximov <[email protected]>
Co-authored-by: Ivan Maximov <[email protected]>
No. It simply is already a ref struct — it is always (and must be) passed by ref; it’s a struct, and it’s internal so the change does not affect the public api or operation but is simply “good housekeeping” I didn’t look at LexerContext |
The change to ref struct prevents accidental storage on the heap, such as seen by the change to the tests |
No description provided.