[dev.typeparams] cmd/compile/internal/types2: type alias decl requires go1.9

Add respective check to type checker.
Remove respective check from the compiler's new type2-based noder.

Updates #31793.

Change-Id: I907e3acab4c136027a8c3db1e9bac301d209c2e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/289570
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Robert Griesemer 2021-02-03 22:34:34 -08:00
parent 721488498a
commit f37b0c6c12
3 changed files with 13 additions and 4 deletions

View file

@ -102,10 +102,6 @@ func (g *irgen) funcDecl(out *ir.Nodes, decl *syntax.FuncDecl) {
func (g *irgen) typeDecl(out *ir.Nodes, decl *syntax.TypeDecl) {
if decl.Alias {
if !types.AllowsGoVersion(types.LocalPkg, 1, 9) {
base.ErrorfAt(g.pos(decl), "type aliases only supported as of -lang=go1.9")
}
name, _ := g.def(decl.Name)
g.pragmaFlags(decl.Pragma, 0)