Does the reflect package support users who implement Type themselves?
https://golang.org/pkg/reflect/#Type has unexported methods, but it's still possible to implement it by embedding a reflect.Type and using the normal (*rtype) type.
The documentation doesn't say that it's not allowed, but apparently people do it:
https://godoc.org/gorgonia.org/tensor#Dtype
This apparently worked (enough? kinda?) at some point, and then we broke it, probably because we never imagined somebody would do this. That led to sending https://golang.org/cl/179338
This bug is to decide whether that's supported and to document. If it's supported, it needs tests.
/cc @ianlancetaylor @rsc @bcmills @randall77 @aclements @cherrymui
Does the reflect package support users who implement Type themselves?
https://golang.org/pkg/reflect/#Type has unexported methods, but it's still possible to implement it by embedding a reflect.Type and using the normal (
*rtype) type.The documentation doesn't say that it's not allowed, but apparently people do it:
This apparently worked (enough? kinda?) at some point, and then we broke it, probably because we never imagined somebody would do this. That led to sending https://golang.org/cl/179338
This bug is to decide whether that's supported and to document. If it's supported, it needs tests.
/cc @ianlancetaylor @rsc @bcmills @randall77 @aclements @cherrymui