mirror of
https://github.com/golang/go
synced 2024-11-24 07:50:13 -07:00
4edefe9568
We changed to delaying all transforms of generic functions, since there are so many complicated situations where type params can be used. We missed changing so that all Call expressions(not just some) are delayed if in a generic function. This changes to delaying all transforms on calls in generic functions. Had to convert Call() to g.callExpr() (so we can access g.delayTransform()). By always delaying transforms on calls in generic functions, we actually simplify the code a bit both in g.CallExpr() and stencil.go. Fixes #51236 Change-Id: I0342c7995254082c4baf709b0b92a06ec14425e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/386220 Reviewed-by: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
23 lines
312 B
Go
23 lines
312 B
Go
// run -gcflags=-G=3
|
|
|
|
// Copyright 2022 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 I interface {
|
|
[]byte
|
|
}
|
|
|
|
func F[T I]() {
|
|
var t T
|
|
explodes(t)
|
|
}
|
|
|
|
func explodes(b []byte) {}
|
|
|
|
func main() {
|
|
|
|
}
|