Commit graph

2 commits

Author SHA1 Message Date
Cuong Manh Le
0f31d742cd cmd/compile: fix ICE with new(<untyped expr>)
Fixes #75617

Change-Id: Iaee7d4556db54b9999f5ba8458e7c05c11ccfc36
Reviewed-on: https://go-review.googlesource.com/c/go/+/707075
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2025-09-26 10:10:03 -07:00
Alan Donovan
7bc1935db5 cmd/compile/internal: support new(expr)
This CL adds compiler support for new(expr),
a feature of go1.26 that allows the user to specify
the initial value of the variable instead of its
type.

Also, a basic test of dynamic behavior.

See CL 704737 for spec change and CL 704935 for
type-checker changes.

For #45624

Change-Id: I65d27de1ee3aabb819b57cce8ea77f3073447757
Reviewed-on: https://go-review.googlesource.com/c/go/+/705157
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2025-09-23 13:12:12 -07:00