mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
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:
parent
dd42a84fb3
commit
545adcfe89
|
@ -753,7 +753,7 @@ func (check *Checker) funcDecl(obj *Func, decl *declInfo) {
|
||||||
obj.color_ = saved
|
obj.color_ = saved
|
||||||
|
|
||||||
if len(fdecl.TParamList) > 0 && fdecl.Body == nil {
|
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
|
// function body must be type-checked after global declarations
|
||||||
|
|
|
@ -174,7 +174,7 @@ func operandString(x *operand, qf Qualifier) string {
|
||||||
if x.typ != Typ[Invalid] {
|
if x.typ != Typ[Invalid] {
|
||||||
var intro string
|
var intro string
|
||||||
if isGeneric(x.typ) {
|
if isGeneric(x.typ) {
|
||||||
intro = " of parameterized type "
|
intro = " of generic type "
|
||||||
} else {
|
} else {
|
||||||
intro = " of type "
|
intro = " of type "
|
||||||
}
|
}
|
||||||
|
|
|
@ -824,7 +824,7 @@ func (check *Checker) funcDecl(obj *Func, decl *declInfo) {
|
||||||
obj.color_ = saved
|
obj.color_ = saved
|
||||||
|
|
||||||
if fdecl.Type.TypeParams.NumFields() > 0 && fdecl.Body == nil {
|
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
|
// function body must be type-checked after global declarations
|
||||||
|
|
|
@ -161,7 +161,7 @@ func operandString(x *operand, qf Qualifier) string {
|
||||||
if x.typ != Typ[Invalid] {
|
if x.typ != Typ[Invalid] {
|
||||||
var intro string
|
var intro string
|
||||||
if isGeneric(x.typ) {
|
if isGeneric(x.typ) {
|
||||||
intro = " of parameterized type "
|
intro = " of generic type "
|
||||||
} else {
|
} else {
|
||||||
intro = " of type "
|
intro = " of type "
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,6 +214,6 @@ func _() {
|
||||||
h /* ERROR cannot index */ [] /* ERROR operand */ ()
|
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]()
|
||||||
|
|
Loading…
Reference in a new issue