If T is a //go:notinheap type, then *T is treated like uintptr rather than pointer-shaped. One consequence of this is that the interface method wrappers for T need to use **T instead of *T.
However, reflectdata.methodWrapper doesn't handle this correctly. For example, this program panics, whereas it succeeds if you remove the //go:notinheap directive: https://play.golang.org/p/p7TiaXlyJzX
Discovered while reimplementing wrapper generation for unified IR.
If
Tis a//go:notinheaptype, then*Tis treated likeuintptrrather than pointer-shaped. One consequence of this is that the interface method wrappers forTneed to use**Tinstead of*T.However, reflectdata.methodWrapper doesn't handle this correctly. For example, this program panics, whereas it succeeds if you remove the
//go:notinheapdirective: https://play.golang.org/p/p7TiaXlyJzXDiscovered while reimplementing wrapper generation for unified IR.