-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
error{} != error{} #7533
Comments
I think the expected behaviour is that Error set types should be cached/hashed based on their content and have structural equality similar to integers. This means that also |
Whoops, I didn't even think to try |
error{}
as generic type param creates new unique type every time
My pr #7092 which implements error set merging in stage2 impliments this correctly. The following test currently passes: |
Apparently, every time you use
error{}
as a generic type param, it creates a new unique type (incompatible with previous expressions of the same type).This is probably "as designed" but I would still like to know for sure (the rules on how generic type identity works are somewhat mysterious to me).
error{}
is probably not the only case where it feels like it should work but doesn't.Side note: the name it came up with,
Writer(writer)
is pretty strange.I am aware of the workarounds:
The text was updated successfully, but these errors were encountered: