cmd/compile: constraints that are impossible to satisfy are not caught #67025
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
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?
I used generic types that refer to each other. This will result in a cycle that is impossible to satisfy (please correct me if I am wrong). From what I've seen the compiler doesn't complain about this loop.
This isn't something I actually do in practice, I was just curious. I don't know if this is legal or reported before. I just thought it would be a good idea to let you know.
Here is Go Playground.
What did you expect to see?
I expect the compiler to complain that this isn't possible.
What did you see instead?
A compiler error regarding types incompatibility. It is not possible to fix this, but the compiler seems to leave the impression that it is possible.
The text was updated successfully, but these errors were encountered: