Files
golang.go/test/fixedbugs/issue78262.go
Robert Griesemer 2de90fd48f cmd/compile/internal/noder: don't shoot oneself (fix silly mistake)
When reading multiple promoted fields in a struct literal from UIR,
don't overwrite the (top-level) struct literal type needed for the
next field.

Fixes #78262.
For #9859.

Change-Id: Ifac64537bebcb7dbb79a6173d0cd032cbf0b8ed8
Reviewed-on: https://go-review.googlesource.com/c/go/+/757225
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-03-20 17:58:12 -07:00

28 lines
379 B
Go

// run
// Copyright 2026 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 main
type A struct {
a int
B
}
type B struct {
b int
C
}
type C struct {
c int
}
func main() {
_ = A{a: 1, b: 2}
_ = A{a: 1, c: 3}
_ = A{a: 1, b: 2, c: 3} // don't panic during compilation
}