-
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: report error for invalid main function signature
This is a port of CL 279424, which didn't make it into master in time for go1.16. Move it to dev.regabi so that it may be merged. Notably, this port no longer removes the _InvalidInitSig error code, instead opting to deprecate it. Now that error codes are 'locked in' for go1.16, even if their API may not yet be exposed, we should follow the practice of not changing their values. In the future, code generation can make it easier to keep error code values constant. For #43308 Change-Id: I5260b93fd063393d38d6458e45a67e7f9b7426ed Reviewed-on: https://go-review.googlesource.com/c/go/+/289714 Trust: Robert Findley <rfindley@google.com> 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
3 changed files
with
20 additions
and
4 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
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,9 @@ | ||
// Copyright 2020 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. | ||
|
||
package main | ||
|
||
func main() | ||
func /* ERROR "no arguments and no return values" */ main /* ERROR redeclared */ (int) | ||
func /* ERROR "no arguments and no return values" */ main /* ERROR redeclared */ () int |