Skip to content

Commit 41f5659

Browse files
Robert Griesemergopherbot
authored andcommitted
go/types, types2: remove superfluous unalias call (minor cleanup)
Change-Id: Ifc0d6e999777513498f070c5bc2fb4640d38c671 Reviewed-on: https://go-review.googlesource.com/c/go/+/712460 Reviewed-by: Robert Griesemer <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Robert Griesemer <[email protected]> Reviewed-by: Mark Freeman <[email protected]>
1 parent e7351c0 commit 41f5659

File tree

4 files changed

+2
-4
lines changed

4 files changed

+2
-4
lines changed

src/cmd/compile/internal/types2/alias.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ func unalias(a0 *Alias) Type {
113113
for a := a0; a != nil; a, _ = t.(*Alias) {
114114
t = a.fromRHS
115115
}
116-
117116
// It's fine to memoize nil types since it's the zero value for actual.
118117
// It accomplishes nothing.
119118
a0.actual = t

src/cmd/compile/internal/types2/signature.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (check *Checker) collectRecv(rparam *syntax.Field, scopePos syntax.Pos) (*V
203203
case *Alias:
204204
// Methods on generic aliases are not permitted.
205205
// Only report an error if the alias type is valid.
206-
if isValid(unalias(t)) {
206+
if isValid(t) {
207207
check.errorf(rbase, InvalidRecv, "cannot define new methods on generic alias type %s", t)
208208
}
209209
// Ok to continue but do not set basetype in this case so that

src/go/types/alias.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/go/types/signature.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (check *Checker) collectRecv(rparam *ast.Field, scopePos token.Pos) (*Var,
226226
case *Alias:
227227
// Methods on generic aliases are not permitted.
228228
// Only report an error if the alias type is valid.
229-
if isValid(unalias(t)) {
229+
if isValid(t) {
230230
check.errorf(rbase, InvalidRecv, "cannot define new methods on generic alias type %s", t)
231231
}
232232
// Ok to continue but do not set basetype in this case so that

0 commit comments

Comments
 (0)