-
Notifications
You must be signed in to change notification settings - Fork 17.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/types: return an error from Instantiate on incorrect len(targs)
Instantiate already returns an error when validation fails. Panicking on an incorrect number of type arguments means that callers must both pre-validate the number of type arguments and handle resulting errors. Returning an error rather than panicking allows eliminating pre-validation at the call-site. Also update the Instantiate docstring to correct some stale/inaccurate information, and to clarify its behavior more precisely. Updates #47916 Change-Id: I997ef30b3486760a90b0db4c3ea7111280d74a81 Reviewed-on: https://go-review.googlesource.com/c/go/+/363635 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
1 changed file
with
30 additions
and
20 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