3 // Copyright 2021 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
14 type pair[F1, F2 any] struct {
20 p := pair[int32, int64]{1, 2}
21 if got, want := unsafe.Sizeof(p.f1), uintptr(4); got != want {
22 panic(fmt.Sprintf("unexpected f1 size == %d, want %d", got, want))
24 if got, want := unsafe.Sizeof(p.f2), uintptr(8); got != want {
25 panic(fmt.Sprintf("unexpected f2 size == %d, want %d", got, want))
33 if mp.f1 != 1 || mp.f2 != 2 {
34 panic(fmt.Sprintf("mp == %#v, want %#v", mp, mypair{1, 2}))