-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/compile: type checking succeeds/fails depending on declaration order #52698
Comments
Looks similar to #52529 |
It's not the same bug, I just checked with current tip. |
I'm poking at this, but not yet very productively. |
Change https://go.dev/cl/408818 mentions this issue: |
Change https://go.dev/cl/409694 mentions this issue: |
Change https://go.dev/cl/410294 mentions this issue: |
Now that validType is using the correct type nest (CL 409694), the top entry of the type nest corresponds to the instantiated type. Thus we can use that type instance to look up the value of type parameters, there's no need anymore to create an environment to look up type arguments. Remove the need to pass around the environment and remove all associated types and functions. Updates #52698. Change-Id: Ie37eace88896386e667ef93c77a4fc3cd0be6eb9 Reviewed-on: https://go-review.googlesource.com/c/go/+/410294 Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
this will cause a compiler error:
https://go.dev/play/p/Mhkjuojm1JF
while this will compile successfully:
https://go.dev/play/p/PLhiCvqhO4W
What did you expect to see?
Compiler should have same behavior on both programs.
What did you see instead?
The first will cause a compiler error while the second will compile successfully.
The text was updated successfully, but these errors were encountered: