-
Notifications
You must be signed in to change notification settings - Fork 18k
compile: Regression in generics #73624
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
Comments
I believe allowing it was a bug, see #60377 |
@seankhliao Have you even looked at the sample code? Whatever was being "fixed" in #60377, has conveniently broken it. Effectively, you are now forcing users do completely unnecessary manual work, instead of allowing compiler correctly do this routine job for them as it was doing before. The only complaints you keep getting now are that "it stopped working." There are no complaints whatsoever that it works incorrectly, or at least counter-intuitively. Entire justification of the change is based on someone's blabber that "something somewhere might go wrong..." What kind of decision making is this? |
Custom generics introduce significant complexity, often outweighing their limited practical benefits. |
Go version
Works in 1.20.14, b0rken after 1.21.13
Output of
go env
in your module/workspace:What did you do?
Playground example is here.
Don't bother to lecture me how "you" could "fix" this in "your" code. Those who will, better first verify how this works with reference implementation of generics.
What did you see happen?
Compilation dies with diagnostics:
./prog.go:9:21: in call to Base_many_6f5dd, cannot infer _84T (declared at ./prog.go:5:22)
Bisected using Docker
golang:1.xx.yy-alpine
images to fail since 1.21.13.What did you expect to see?
Works as in original early version.
The text was updated successfully, but these errors were encountered: