whoa! The only downside I see here is that this API will only be efficient if the compiler supports it. But I suppose we already assume that for many other optimizations (e.g. "I know this will compile to memclr")https://twitter.com/FiloSottile/status/1151890262861520898 …
"Devirtualization" is also very cool, and something that I've wanted for a while: https://github.com/golang/go/issues/19361#issuecomment-480997807 … This definitely weakens the "return structs, not interfaces" idiom, but I'd argue it's still good design (since you can't always devirtualize).