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: interface conversion with generics reports "types from different scopes" [1.18 backport] #53883
Comments
CC @golang/compiler |
So, works okay at go1.19 tip, does not work with the revert to the cause of #53852.
|
Git bisect seems to have identified e1b14f5 for me. But I was also chasing some false leads earlier due to git bisects and I can't immediately see how that commit could be related, so I'm a bit suspicious still. |
This is strengthening the case for "generics backports considered harmful". |
Adding yet further questions, I think the assert added in that CL is backwards: But then why are we ending up with a runtime panic, rather than an ICE. |
Change https://go.dev/cl/417616 mentions this issue: |
Same as #53376? |
IMO this should be fixed in go1.18.5 as unfortunate regression, because this works in go1.18.2. Probably with reverting some backported CL-s that have introduced this between go1.18.2 and go1.18.3. If not, there is workaround to use func f[T a, C A[T]](foo T, bar C) Instead of func f[T a](foo T, bar A[T]) |
Closed by merging 76ba1a5 to release-branch.go1.18. |
This reverts CL 405436 (commit e1b14f5). Fixes #53883. Updates #51840. Change-Id: Ide5a9568a7ae5b449ef154c29b69699a7e4b3f6b Reviewed-on: https://go-review.googlesource.com/c/go/+/417616 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Jenny Rakoczy <jenny@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
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?
What did you expect to see?
When running the program I expect the output to be:
<nil>
When compiling and running with Go 1.18.2 it works as expected. Please also read my remarks on #52027
What did you see instead?
As already mentioned above. Running the Program (compiled with 1.8.4) gives me the output:
The text was updated successfully, but these errors were encountered: