-
Notifications
You must be signed in to change notification settings - Fork 131
Fix Parsers.Parser.|||
(by adding equality comparison for Position
objects)
#507
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
hi! welcome to the repo
could you add a test case to demonstrate the issue that is now fixed, and to prevent it from regressing in the future? |
It's a bit puzzling to me that this would have fixed anything, given that the only two subtypes of |
The issue is from an assumption in this pattern: https://github.com/scala/scala-parser-combinators/blob/main/shared/src/main/scala/scala/util/parsing/combinator/Parsers.scala#L422 - it seems obvious that if |
I'm not seeing the same behavior when I run |
e824266
to
f61d9a0
Compare
f61d9a0
to
11e08c6
Compare
I'm also having trouble with triggering the same error locally. |
The puzzle might be explained by the fact that https://github.com/scala/scala-parser-combinators/blob/main/shared/src/main/scala/scala/util/parsing/input/StreamReader.scala#L69 creates an anonymous subclass of |
Ah, that seems to makes sense, though to be really sure, I'd have to dig deeper than I have time to do. We are... understaffed in this repo for knowledgeable PR review. As a result, I'm not sure how to proceed; optimistically merge, or ask you to further defend the change. wdyt? How sure are you this is now right? (Anyone else watching the repo available to weigh in?) |
Thanks for the response. I have plenty on my plate, as well, so I understand. I am happy to further defend the change but thought I'd answered all of your questions: the tests I added demonstrate correct behavior and if you comment out the I would much rather that you wait until you're comfortable merging. Is there anything else I can answer or tweak? (Happy to have comments from others on the repo, too.) |
Thank you! |
Parsers.Parser.|||
(by adding equality comparison for Position
objects)
### What changes were proposed in this pull request? This pr aims to upgrade `scala-parser-combinators` from 2.2.0 to 2.3.0 ### Why are the changes needed? The new version [dropped support for Scala 2.11](scala/scala-parser-combinators#504) and bring a bug fix: - scala/scala-parser-combinators#507 The full release notes as follows: - https://github.com/scala/scala-parser-combinators/releases/tag/v2.3.0 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Pass Github Actions Closes #41848 from LuciferYang/scala-parser-combinators-23. Authored-by: yangjie01 <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
Parsers.Parser.|||
was not working as expected. I looked into it and discovered thatPosition
objects were using pointer equality, not structural equality. I added this equality function and it fixed the issue.I won't be offended if there are changes that need to be made to make this more idiomatic or whatever.