Open
Description
Example:
package main
import (
"fmt"
)
type arrPtr *[3]byte
func main() {
var s1 *[3]byte = nil
var s2 arrPtr = arrPtr(s1)
var s3 arrPtr = nil
fmt.Println(s1, s2, s3)
}
Expected output: <nil> <nil> <nil>
.
Actual output: <nil> &[] <nil>
.
Proximate cause: here, instead of treating the conversion is a no-op, it should check if the original value was a nil pointer of the original type, and return the nil object of the desired type. Counter-intuitively, in GopherJS each type that can be nil
represents the nil
value with its own unique object. This issue is one of the motivating examples for #1238.