aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/alias.go
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2024-04-24 16:51:20 -0400
committerGopher Robot <gobot@golang.org>2024-04-24 21:50:16 +0000
commit9b9de261bd66333885adb7b36f1dd133d00cfe13 (patch)
tree3b938dd035cb2f3036d066969279d397d556ad6a /src/cmd/compile/internal/types2/alias.go
parente689118852c9c1841ee4c17aeeb3ec3a5242e9a2 (diff)
downloadgo-9b9de261bd66333885adb7b36f1dd133d00cfe13.tar.gz
go-9b9de261bd66333885adb7b36f1dd133d00cfe13.zip
go/types: add Alias.Rhs
This method returns the type on the right-hand side of an alias declaration such as type L = R. Fixes #66559 Change-Id: I396f2d999680ad251f47cdde20856ae20fc1c40a Reviewed-on: https://go-review.googlesource.com/c/go/+/581615 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/alias.go')
-rw-r--r--src/cmd/compile/internal/types2/alias.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/types2/alias.go b/src/cmd/compile/internal/types2/alias.go
index 030f6cd827..9b7a13f81e 100644
--- a/src/cmd/compile/internal/types2/alias.go
+++ b/src/cmd/compile/internal/types2/alias.go
@@ -32,11 +32,9 @@ func (a *Alias) Obj() *TypeName { return a.obj }
func (a *Alias) Underlying() Type { return unalias(a).Underlying() }
func (a *Alias) String() string { return TypeString(a, nil) }
-// TODO(adonovan): uncomment when proposal #66559 is accepted.
-//
-// // Rhs returns the type R on the right-hand side of an alias
-// // declaration "type A = R", which may be another alias.
-// func (a *Alias) Rhs() Type { return a.fromRHS }
+// Rhs returns the type R on the right-hand side of an alias
+// declaration "type A = R", which may be another alias.
+func (a *Alias) Rhs() Type { return a.fromRHS }
// Unalias returns t if it is not an alias type;
// otherwise it follows t's alias chain until it