Original issue: https://github.com/golang/go/issues/24817. It should be backported because the generated code is incorrect.