-
Notifications
You must be signed in to change notification settings - Fork 59
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
AST
s aren't Equatable
?
#1204
Comments
I guess the failure occurred because deserialization doesn't assign |
If all the parts are Codable it should just serialize/deserialize automatically. But is there a reason ASTs can't be equatable? |
No because
No, but implementing |
Note that I think we'll have to accept that two ASTs parsed from the same sources might have different representations if we want to ever support incremental compilation. |
Oh, and we have customized serialization. Presumably you could have left it outside
Wow, I'm so lost now. I'm only aware of one case of observed UB (which could be suppressed by not writing a shared cache or not parallelizing type checking), and didn't realize it was associated with a change Lucian made, or (obviously) which change that would have been, and as far as I knew until reading this, it was still a mystery. Have you solved it? What was the issue? Was the property being inside
Why? Isn't parsing a deterministic process? Regardless, if it weren't, that care is easy enough to take if we know each node's type and source range; we can just sort them before comparing. As a general principle, unless there's a really good reason why it cannot be so, all values ought to be |
I personally don't care whether the representations match as long as they can be compared for equality. Arguably anything containing a |
Nothing was identified or solved. The bug just showed up when Lucian increased the memory footprint of the AST. Presumably I did the same when I wrote |
I am not saying we can't define equality, only that if we want to do it correctly we probably can't just slap |
We need to have a more general discussion about what we mean by incremental compilation and what its implications will be for our data structures, c.f. #1163 (comment) |
Maybe I knew this and understood why at one point but now I find it really problematic.
Sure makes it hard to validate serialization!
This failure suggests ASTs don't make a successful round-trip. The failure is an unexpected nil optional in
The text was updated successfully, but these errors were encountered: