Go version
go version go1.26.1 linux/amd64
Output of go env in your module/workspace:
What did you do?
Case 1:
package main
//go:fix inline
func foo[T [8]byte | [4]uint16]() {
var v T
var n byte = 1 << len(v) >> len(v)
if n == 0 {
println("T is [8]byte")
} else {
println("T is [4]uint16]")
}
}
func main() {
foo[[8]byte]()
}
Case 2:
package main
import "unsafe"
//go:fix inline
func foo[T any]() {
var t T
_ = 1 / unsafe.Sizeof(t)
}
func main() {
foo[struct{}]()
}
What did you see happen?
Code behavior changes.
What did you expect to see?
Not change code behavior.
Go version
go version go1.26.1 linux/amd64
Output of
go envin your module/workspace:.What did you do?
Case 1:
Case 2:
What did you see happen?
Code behavior changes.
What did you expect to see?
Not change code behavior.