cmd/compile: union of embeddings should not eagerly evaluate parameters #49053
Labels
FrozenDueToAge
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?
N/A (tip)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
While exploring the tip generics implementation, I attempted to determine if I could express "precise numeric conversions" (conversions that cannot cause overflow or loss of precision, such as int8 -> int16, but not the reverse).
What did you expect to see?
Concerning:
I would expect the instantiation to be valid if the
To
parameter is valid for any of the embedded constraints within the union. I would not expect that theTo
parameter would need to validate against all possible embedded constraints for the same reason that a type does not need to satisfy all ofint8 | int16
simultaneously.What did you see instead?
When attempting to run, I see:
The text was updated successfully, but these errors were encountered: