]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/types2: remove superfluous ordinaryType calls
authorRobert Griesemer <gri@golang.org>
Tue, 31 Aug 2021 00:18:07 +0000 (17:18 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 31 Aug 2021 16:14:01 +0000 (16:14 +0000)
commitded10d75a908b584331d01c9c0eaf1cfcb951cac
tree6fb927dd67c8aa070b51b46a8cc470cd7511b54e
parent3920d6f2085559ae262d651b00bf8b29f953580a
cmd/compile/internal/types2: remove superfluous ordinaryType calls

The value types in type assertions and type switches cannot be
constraint types (if there are, an error was reported earlier),
so there is no need to check again that they are not constraint
types.

This permits merging the ordinaryType call with varType, which
is the only place where it's needed.

Change-Id: I44a852377b3dddf53692f764e588801fb3d3c0a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/346291
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue42758.go2
src/cmd/compile/internal/types2/typexpr.go