The compilation of the following program fails with error ./prog.go:4:10: invalid constant type P
package main
func f[P int]() {
const y P = 5
}
func main() {}
but this behavior is not documented in the spec.
From the spec 5 is assignable to P because it is an untyped constant representable by a value of type P.