]> Cypherpunks.ru repositories - gostls13.git/commitdiff
go/types, types2: use "generic" rather than "parameterized" in error messages
authorRobert Griesemer <gri@golang.org>
Thu, 29 Sep 2022 18:18:09 +0000 (11:18 -0700)
committerRobert Griesemer <gri@google.com>
Thu, 29 Sep 2022 19:35:55 +0000 (19:35 +0000)
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>
src/cmd/compile/internal/types2/decl.go
src/cmd/compile/internal/types2/operand.go
src/go/types/decl.go
src/go/types/operand.go
src/internal/types/testdata/examples/functions.go

index ec9f15466490e5392e4f72ca31eaec0213578092..b99e1dcd77b58453ad3c8c75c3399a927e9ef493 100644 (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
index aadcc3a8dbeb000c50f8fe7930944d2968d3ac52..07a5d16bbcde20cd3fb7c2bcd92864edf936956f 100644 (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 "
                        }
index 628c7bb5d97723c28ad0020291d314cfac2eed58..b610985f76b90172285fa03f0978d0ffa576a4ef 100644 (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
index 4cb7a36460529d9bfb28cce57e1f04332d91948b..e398ba14f24a4b4195baada04ea8c0351bee9b6f 100644 (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 "
                        }
index 244c9dd22839986d551037ca27541f9765122dfc..47e1c35f3dd6b8b2b28fbf2a728901b433511ab7 100644 (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]()