-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev.regabi] go/types: type alias decl requires go1.9
This is a port of CL 289570 to go/types. It has some notable differences with that CL: + A new _BadDecl error code is added, to indicate declarations with bad syntax. + declInfo is updated hold not an 'alias' bool, but an aliasPos token.Pos to identify the location of the type aliasing '=' token. This allows for error messages to be accurately placed on the '=' For #31793 Change-Id: Ib15969f9cd5be30228b7a4c6406f978d6fc58018 Reviewed-on: https://go-review.googlesource.com/c/go/+/291318 Trust: Robert Findley <rfindley@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
- Loading branch information
Showing
4 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1366,4 +1366,7 @@ const ( | |
// return i | ||
// } | ||
_InvalidGo | ||
|
||
// _BadDecl occurs when a declaration has invalid syntax. | ||
_BadDecl | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright 2021 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. | ||
|
||
// Check Go language version-specific errors. | ||
|
||
package go1_8 // go1.8 | ||
|
||
// type alias declarations | ||
type any = /* ERROR type aliases requires go1.9 or later */ interface{} | ||
|