go/test/typeparam/issue50552.dir/a.go
Dan Scales ad7eae21d5 cmd/compile: resolve dictionaries/shape methods in markInlBody, if needed
Issue #50552 is due to a problem with my recent improvement in the
interaction between generics and inlining. In markInlBody(), we now mark
dictionaries and shape methods for export, so they will be available for
any package that inlines the current inlineable function. But we need to
make sure that the dictionary and method symbols have actually been
resolved into Nodes (looked up in the import data), if they are not
already defined, so we can then mark them for export.

Improved header comment on Resolve().

Fixes #50552

Change-Id: I89e52d39d3b9894591d2ad6eb3a8ed3bb5f1e0a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/377714
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
2022-01-11 21:51:51 +00:00

17 lines
196 B
Go

package a
type Builder[T any] struct{}
func (r Builder[T]) New() T {
var v T
return v
}
func (r Builder[T]) New2() T {
return r.New()
}
func BuildInt() int {
return Builder[int]{}.New()
}