go/types, types2: use "generic" rather than "parameterized" in error messages

Fix a couple of places where we still use "parameterized".

Change-Id: I2c70356d4e363ee709c5ef19ec8786956d5e9001
Reviewed-on: https://go-review.googlesource.com/c/go/+/436815
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Robert Griesemer 2022-09-29 11:18:09 -07:00 committed by Robert Griesemer
parent dd42a84fb3
commit 545adcfe89
5 changed files with 6 additions and 6 deletions

View file

@ -753,7 +753,7 @@ func (check *Checker) funcDecl(obj *Func, decl *declInfo) {
obj.color_ = saved
if len(fdecl.TParamList) > 0 && fdecl.Body == nil {
check.softErrorf(fdecl, _BadDecl, "parameterized function is missing function body")
check.softErrorf(fdecl, _BadDecl, "generic function is missing function body")
}
// function body must be type-checked after global declarations

View file

@ -174,7 +174,7 @@ func operandString(x *operand, qf Qualifier) string {
if x.typ != Typ[Invalid] {
var intro string
if isGeneric(x.typ) {
intro = " of parameterized type "
intro = " of generic type "
} else {
intro = " of type "
}

View file

@ -824,7 +824,7 @@ func (check *Checker) funcDecl(obj *Func, decl *declInfo) {
obj.color_ = saved
if fdecl.Type.TypeParams.NumFields() > 0 && fdecl.Body == nil {
check.softErrorf(fdecl.Name, _BadDecl, "parameterized function is missing function body")
check.softErrorf(fdecl.Name, _BadDecl, "generic function is missing function body")
}
// function body must be type-checked after global declarations

View file

@ -161,7 +161,7 @@ func operandString(x *operand, qf Qualifier) string {
if x.typ != Typ[Invalid] {
var intro string
if isGeneric(x.typ) {
intro = " of parameterized type "
intro = " of generic type "
} else {
intro = " of type "
}

View file

@ -214,6 +214,6 @@ func _() {
h /* ERROR cannot index */ [] /* ERROR operand */ ()
}
// Parameterized functions must have a function body.
// Generic functions must have a function body.
func _ /* ERROR missing function body */ [P any]()
func _ /* ERROR generic function is missing function body */ [P any]()