1
0
mirror of https://github.com/golang/go synced 2024-11-24 15:50:11 -07:00
go/test/typeparam/issue47929.go
Dan Scales 099b819085 cmd/compile: fix CheckSize() calculation for -G=3 and stencils
Because the Align/Width of pointer types are always set when created,
CalcSize() never descends past a pointer. Therefore, we need to do
CheckSize() at every level when creating type. We need to do this for
types creates by types2-to-types1 conversion and also by type
substitution (mostly for stenciling). We also need to do
Defer/ResumeCheckSize() at the top level in each of these cases to deal
with potentially recursive types.

These changes fix issue #47929 and also allow us to remove the
special-case CheckSize() call that causes the problem for issue #47901.

Fixes #47901
Fixes #47929

Change-Id: Icd8192431c145009cd6df2f4ade6db7da0f4dd3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/344829
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2021-08-25 15:30:19 +00:00

30 lines
535 B
Go

// compile -G=3 -p=p
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package v4
var sink interface{}
//go:noinline
func Do(result, body interface{}) {
sink = &result
}
func DataAction(result DataActionResponse, body DataActionRequest) {
Do(&result, body)
}
type DataActionRequest struct {
Action *interface{}
}
type DataActionResponse struct {
ValidationErrors *ValidationError
}
type ValidationError struct {
}