mirror of
https://github.com/golang/go
synced 2024-11-22 10:44:41 -07:00
adae6ec542
First law of cmd/compile frontend development: thou shalt not rely on types.Sym. This CL replaces Type.OrigSym with Type.OrigType, which semantically matches what all of the uses within the frontend actually care about, and avoids using types.Sym, which invariably leads to mistakes because symbol scoping in the frontend doesn't work how anyone intuitively expects it to. Fixes #51765. Change-Id: I4affe6ee0718103ce5006ab68aa7e1bb0cac6881 Reviewed-on: https://go-review.googlesource.com/c/go/+/394274 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
16 lines
308 B
Go
16 lines
308 B
Go
// compile
|
|
|
|
// 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 p
|
|
|
|
type empty[T any] struct{}
|
|
|
|
func (this *empty[T]) Next() (empty T, _ error) {
|
|
return empty, nil
|
|
}
|
|
|
|
var _ = &empty[string]{}
|