Closed
Description
This code compiles with Go 1.19, but currently fails with GOEXPERIMENT=unified because -1 is not representable by type uint.
package p
func f[Int int, Uint uint]() {
_ = uint(Int(-1))
_ = uint(Uint(0) - 1)
}
var _ = f[int, uint]
Per the Go spec, "If the type is a type parameter, the constant is converted into a non-constant value of the type parameter."
(Noticed at https://github.com/lightstep/otel-launcher-go/blob/448fc6822e81fdde2763f224bd9c7f3bbf72309c/lightstep/sdk/metric/aggregator/histogram/structure/exponential.go#L640, while investigating #54302.)