-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: can't use aliased type as underlying type in type parameter #68935
Comments
@gopherbot please backport this issue to go1.23 release. This is a bug in compiler type checker without any workaround. |
Backport issue(s) opened: #68938 (for 1.23). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/606635 mentions this issue: |
Duplicate of #68903 |
Change https://go.dev/cl/606075 mentions this issue: |
Unalias the ~T terms during underIs. Before, if T was an alias of U, it may pass T to the iteration function. The iterator function expects an underlying type, under(U), to be passed. This caused several bugs where underIs is used without eventually taking the underlying type. Updates #68935 Fixes #68903 Change-Id: Ie8691d8dddaea00e1dcba94d17c0f1b021fc49a2 Reviewed-on: https://go-review.googlesource.com/c/go/+/606075 Reviewed-by: Robert Griesemer <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Robert Findley <[email protected]>
Change https://go.dev/cl/607635 mentions this issue: |
Go version
go version go1.23.0 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Starting from Go 1.23, I get 'invalid composite literal type T' error.
Please check the playground link which fails on Go 1.23.
https://go.dev/play/p/smVJSzGiGbn
I think I could not find any hint on this kind of change in release note, or was there?
What did you see happen?
Got 'invalid composite literal type T' error when building originally working codebase.
What did you expect to see?
Build should be successful.
The text was updated successfully, but these errors were encountered: