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
x/tools: tests are broken with tip Go #44316
Comments
I took a look but I'm not familiar with those tests and couldn't tell what the problem is. It seems all failures are related to |
It's likely that this due to a change in go/types that I made in dev.regabi. I can't look for 30 minutes or so, but https://golang.org/cl/289720 comes to mind given @cherrymui's description. |
BTW, failures looks like https://build.golang.org/log/35d8dfbfdecd12e2a4a09df89b83dd9240dc7c66
Otheres seem similar. |
Seems like this is probably a benign bug either in go/types or the gopls tests. So I'm gonna go eat dinner. |
Thanks Heschi for bisecting. I'm looking at this now. OK this change was certainly intentional. However, looking at this failure, I think perhaps I didn't spend enough time considering its repercussions. In particular, we seem to still be inconsistent with the compiler. Consider this: Two observations:
So rather than work around this in gopls tests, I think I should revert https://golang.org/cl/289712 until we can consider it further. CC @griesemer |
Change https://golang.org/cl/292751 mentions this issue: |
FWIW, historically the compiler didn't report unused variables until code generation, so they were only reported if the user code successfully typechecked otherwise. I moved that to the frontend recently, but unused variables are still reported only for functions that successfully typecheck, and (IIRC) if we haven't seen any errors previously yet. I think this might be a situation where it's easier to update cmd/compile to match go/types behavior instead, or at least find some common middleground. The compiler's current behavior here certainly isn't principled enough to merit trying to reproduce it. |
Thanks for the background.
Perhaps this could be as simple as the compiler filtering out 'soft' errors from types2 in the presence of any 'hard' errors. We've debated the value of having this hardness dimension, but this seems like the perfect use-case for it. |
Err, reopening this until the build dashboard clears up, in case anyone goes looking for an open issue related to the failures. |
Ok, x/tools builds are clean now. |
Thanks for the quick investigation and fix, everyone!
I'd rather not try to do any non-trivial error filtering outside of types2. I think we'll lose too much context to make good decisions that way. I think the most limiting factor is how tedious it is to update the regress tests. If you come up with a sensible way to decide which errors to report that isn't too painful to update the regress tests, then it should be easy to match typecheck's behavior to that. The main reason I left the unused variable error as kind of weird is because I didn't want to modify a whole bunch of regress test files, knowing that a lot of them were probably also modified on the dev.typeparams branch. That just seemed like it would be a merge nightmare. |
FWIW, this would be (mostly) trivial filtering. go/types exposes the |
@mdempsky
@golang/release
@stamblerre
It appears that something merged to tip today has broken the gopls tests. I'm bisecting.
The text was updated successfully, but these errors were encountered: