]> Cypherpunks.ru repositories - gostls13.git/commitdiff
go/types, types2: rename allowVersionf to verifyVersionf
authorRobert Griesemer <gri@golang.org>
Wed, 3 May 2023 19:16:40 +0000 (12:16 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 3 May 2023 20:35:49 +0000 (20:35 +0000)
Follow-up on comment in CL 491715.

Change-Id: Ie6a71859e791434b7ab53c5524f35718a3567ecb
Reviewed-on: https://go-review.googlesource.com/c/go/+/492236
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
16 files changed:
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/decl.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/resolver.go
src/cmd/compile/internal/types2/typeset.go
src/cmd/compile/internal/types2/typexpr.go
src/cmd/compile/internal/types2/version.go
src/go/types/builtins.go
src/go/types/call.go
src/go/types/decl.go
src/go/types/expr.go
src/go/types/resolver.go
src/go/types/typeset.go
src/go/types/typexpr.go
src/go/types/version.go

index d91f98471e902dc3ee4b1d177db3bbce3e514555..3dcef64146fb0d8f2228e410ad1b87f647246c92 100644 (file)
@@ -234,7 +234,7 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (
 
        case _Clear:
                // clear(m)
-               if !check.allowVersionf(check.pkg, call.Fun, go1_21, "clear") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_21, "clear") {
                        return
                }
 
@@ -625,7 +625,7 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (
 
        case _Add:
                // unsafe.Add(ptr unsafe.Pointer, len IntegerType) unsafe.Pointer
-               if !check.allowVersionf(check.pkg, call.Fun, go1_17, "unsafe.Add") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_17, "unsafe.Add") {
                        return
                }
 
@@ -760,7 +760,7 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (
 
        case _Slice:
                // unsafe.Slice(ptr *T, len IntegerType) []T
-               if !check.allowVersionf(check.pkg, call.Fun, go1_17, "unsafe.Slice") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_17, "unsafe.Slice") {
                        return
                }
 
@@ -784,7 +784,7 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (
 
        case _SliceData:
                // unsafe.SliceData(slice []T) *T
-               if !check.allowVersionf(check.pkg, call.Fun, go1_20, "unsafe.SliceData") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_20, "unsafe.SliceData") {
                        return
                }
 
@@ -802,7 +802,7 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (
 
        case _String:
                // unsafe.String(ptr *byte, len IntegerType) string
-               if !check.allowVersionf(check.pkg, call.Fun, go1_20, "unsafe.String") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_20, "unsafe.String") {
                        return
                }
 
@@ -825,7 +825,7 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (
 
        case _StringData:
                // unsafe.StringData(str string) *byte
-               if !check.allowVersionf(check.pkg, call.Fun, go1_20, "unsafe.StringData") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_20, "unsafe.StringData") {
                        return
                }
 
index 040de8da5259f5f1c29bd763d3ec61ea16520555..c6d1590016c253277b0ee4e35e94c0759695579e 100644 (file)
@@ -29,7 +29,7 @@ func (check *Checker) funcInst(tsig *Signature, pos syntax.Pos, x *operand, inst
        } else {
                instErrPos = pos
        }
-       versionErr := !check.allowVersionf(check.pkg, instErrPos, go1_18, "function instantiation")
+       versionErr := !check.verifyVersionf(check.pkg, instErrPos, go1_18, "function instantiation")
 
        // targs and xlist are the type arguments and corresponding type expressions, or nil.
        var targs []Type
@@ -292,7 +292,7 @@ func (check *Checker) callExpr(x *operand, call *syntax.CallExpr) exprKind {
                // is an error checking its arguments (for example, if an incorrect number
                // of arguments is supplied).
                if got == want && want > 0 {
-                       check.allowVersionf(check.pkg, inst, go1_18, "function instantiation")
+                       check.verifyVersionf(check.pkg, inst, go1_18, "function instantiation")
 
                        sig = check.instantiateSignature(inst.Pos(), sig, targs, xlist)
                        assert(sig.TypeParams().Len() == 0) // signature is not generic anymore
@@ -505,7 +505,7 @@ func (check *Checker) arguments(call *syntax.CallExpr, sig *Signature, targs []T
                }
        }
        // at the moment we only support implicit instantiations of argument functions
-       _ = len(genericArgs) > 0 && check.allowVersionf(check.pkg, args[genericArgs[0]], go1_21, "implicitly instantiated function as argument")
+       _ = len(genericArgs) > 0 && check.verifyVersionf(check.pkg, args[genericArgs[0]], go1_21, "implicitly instantiated function as argument")
 
        // tparams holds the type parameters of the callee and generic function arguments, if any:
        // the first n type parameters belong to the callee, followed by mi type parameters for each
index d35a044ffcd2ecb6a8f9cf6d1e041284946e63fe..193308f197cbce2b5c03b02a16f827f4f16c5106 100644 (file)
@@ -492,7 +492,7 @@ func (check *Checker) typeDecl(obj *TypeName, tdecl *syntax.TypeDecl, def *Named
                        check.validType(t)
                }
                // If typ is local, an error was already reported where typ is specified/defined.
-               _ = check.isImportedConstraint(rhs) && check.allowVersionf(check.pkg, tdecl.Type, go1_18, "using type constraint %s", rhs)
+               _ = check.isImportedConstraint(rhs) && check.verifyVersionf(check.pkg, tdecl.Type, go1_18, "using type constraint %s", rhs)
        }).describef(obj, "validType(%s)", obj.Name())
 
        alias := tdecl.Alias
@@ -505,7 +505,7 @@ func (check *Checker) typeDecl(obj *TypeName, tdecl *syntax.TypeDecl, def *Named
 
        // alias declaration
        if alias {
-               check.allowVersionf(check.pkg, tdecl, go1_9, "type aliases")
+               check.verifyVersionf(check.pkg, tdecl, go1_9, "type aliases")
                check.brokenAlias(obj)
                rhs = check.typ(tdecl.Type)
                check.validAlias(obj, rhs)
index 7dda8267c8e78f87e8ea7874ed3dcd2ffc9a4313..295c497054b0a8de8102a4679c1226f71e8ac3b3 100644 (file)
@@ -977,7 +977,7 @@ func (check *Checker) shift(x, y *operand, e syntax.Expr, op syntax.Operator) {
                // Check that RHS is otherwise at least of integer type.
                switch {
                case allInteger(y.typ):
-                       if !allUnsigned(y.typ) && !check.allowVersionf(check.pkg, y, go1_13, invalidOp+"signed shift count %s", y) {
+                       if !allUnsigned(y.typ) && !check.verifyVersionf(check.pkg, y, go1_13, invalidOp+"signed shift count %s", y) {
                                x.mode = invalid
                                return
                        }
index f856dae47c920946d97681dbb73609dbf2a81742..e1fe5aa9b7c41143f079e96131d4700a2f7cef42 100644 (file)
@@ -406,7 +406,7 @@ func (check *Checker) collectObjects() {
                                }
 
                        case *syntax.TypeDecl:
-                               _ = len(s.TParamList) != 0 && check.allowVersionf(pkg, s.TParamList[0], go1_18, "type parameter")
+                               _ = len(s.TParamList) != 0 && check.verifyVersionf(pkg, s.TParamList[0], go1_18, "type parameter")
                                obj := NewTypeName(s.Name.Pos(), pkg, s.Name.Value, nil)
                                check.declarePkgObj(s.Name, obj, &declInfo{file: fileScope, tdecl: s})
 
@@ -453,7 +453,7 @@ func (check *Checker) collectObjects() {
                                        }
                                        check.recordDef(s.Name, obj)
                                }
-                               _ = len(s.TParamList) != 0 && !hasTParamError && check.allowVersionf(pkg, s.TParamList[0], go1_18, "type parameter")
+                               _ = len(s.TParamList) != 0 && !hasTParamError && check.verifyVersionf(pkg, s.TParamList[0], go1_18, "type parameter")
                                info := &declInfo{file: fileScope, fdecl: s}
                                // Methods are not package-level objects but we still track them in the
                                // object map so that we can handle them like regular functions (if the
index 7873cc216200e680e2c92c23ba094c5bdb4b0442..fe1d8773cda2d44a6a3dbb7f5fb23b3742d47303 100644 (file)
@@ -278,7 +278,7 @@ func computeInterfaceTypeSet(check *Checker, pos syntax.Pos, ityp *Interface) *_
                        assert(!isTypeParam(typ))
                        tset := computeInterfaceTypeSet(check, pos, u)
                        // If typ is local, an error was already reported where typ is specified/defined.
-                       if check != nil && check.isImportedConstraint(typ) && !check.allowVersionf(check.pkg, pos, go1_18, "embedding constraint interface %s", typ) {
+                       if check != nil && check.isImportedConstraint(typ) && !check.verifyVersionf(check.pkg, pos, go1_18, "embedding constraint interface %s", typ) {
                                continue
                        }
                        comparable = tset.comparable
@@ -287,7 +287,7 @@ func computeInterfaceTypeSet(check *Checker, pos syntax.Pos, ityp *Interface) *_
                        }
                        terms = tset.terms
                case *Union:
-                       if check != nil && !check.allowVersionf(check.pkg, pos, go1_18, "embedding interface element %s", u) {
+                       if check != nil && !check.verifyVersionf(check.pkg, pos, go1_18, "embedding interface element %s", u) {
                                continue
                        }
                        tset := computeUnionTypeSet(check, unionSets, pos, u)
@@ -301,7 +301,7 @@ func computeInterfaceTypeSet(check *Checker, pos syntax.Pos, ityp *Interface) *_
                        if u == Typ[Invalid] {
                                continue
                        }
-                       if check != nil && !check.allowVersionf(check.pkg, pos, go1_18, "embedding non-interface type %s", typ) {
+                       if check != nil && !check.verifyVersionf(check.pkg, pos, go1_18, "embedding non-interface type %s", typ) {
                                continue
                        }
                        terms = termlist{{false, typ}}
index 31407e0a59110382273c210f6aa8eb259872f9d6..1670b12a96aa3f5676fea7d1096979906382f964 100644 (file)
@@ -42,7 +42,7 @@ func (check *Checker) ident(x *operand, e *syntax.Name, def *Named, wantType boo
                }
                return
        case universeAny, universeComparable:
-               if !check.allowVersionf(check.pkg, e, go1_18, "predeclared %s", e.Value) {
+               if !check.verifyVersionf(check.pkg, e, go1_18, "predeclared %s", e.Value) {
                        return // avoid follow-on errors
                }
        }
@@ -271,7 +271,7 @@ func (check *Checker) typInternal(e0 syntax.Expr, def *Named) (T Type) {
                }
 
        case *syntax.IndexExpr:
-               check.allowVersionf(check.pkg, e, go1_18, "type instantiation")
+               check.verifyVersionf(check.pkg, e, go1_18, "type instantiation")
                return check.instantiatedType(e.X, unpackExpr(e.Index), def)
 
        case *syntax.ParenExpr:
index ad3aa85693eb23f253a4f27da18886755c9ef9c1..3b655aad38ac64e53cf45049a32605d79fd036bd 100644 (file)
@@ -140,9 +140,9 @@ func (check *Checker) allowVersion(pkg *Package, at poser, v version) bool {
        return check.version.equal(go0_0) || !check.version.before(v)
 }
 
-// allowVersionf is like allowVersion but also accepts a format string and arguments
+// verifyVersionf is like allowVersion but also accepts a format string and arguments
 // which are used to report a version error if allowVersion returns false.
-func (check *Checker) allowVersionf(pkg *Package, at poser, v version, format string, args ...interface{}) bool {
+func (check *Checker) verifyVersionf(pkg *Package, at poser, v version, format string, args ...interface{}) bool {
        if !check.allowVersion(pkg, at, v) {
                check.versionErrorf(at, v, format, args...)
                return false
index 203c248df1a69ce7c822e448c95aaaea1732ff16..361a76021167cdd1a5f60b18b72f2a279cad20e8 100644 (file)
@@ -235,7 +235,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
 
        case _Clear:
                // clear(m)
-               if !check.allowVersionf(check.pkg, call.Fun, go1_21, "clear") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_21, "clear") {
                        return
                }
 
@@ -626,7 +626,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
 
        case _Add:
                // unsafe.Add(ptr unsafe.Pointer, len IntegerType) unsafe.Pointer
-               if !check.allowVersionf(check.pkg, call.Fun, go1_17, "unsafe.Add") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_17, "unsafe.Add") {
                        return
                }
 
@@ -761,7 +761,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
 
        case _Slice:
                // unsafe.Slice(ptr *T, len IntegerType) []T
-               if !check.allowVersionf(check.pkg, call.Fun, go1_17, "unsafe.Slice") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_17, "unsafe.Slice") {
                        return
                }
 
@@ -785,7 +785,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
 
        case _SliceData:
                // unsafe.SliceData(slice []T) *T
-               if !check.allowVersionf(check.pkg, call.Fun, go1_20, "unsafe.SliceData") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_20, "unsafe.SliceData") {
                        return
                }
 
@@ -803,7 +803,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
 
        case _String:
                // unsafe.String(ptr *byte, len IntegerType) string
-               if !check.allowVersionf(check.pkg, call.Fun, go1_20, "unsafe.String") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_20, "unsafe.String") {
                        return
                }
 
@@ -826,7 +826,7 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
 
        case _StringData:
                // unsafe.StringData(str string) *byte
-               if !check.allowVersionf(check.pkg, call.Fun, go1_20, "unsafe.StringData") {
+               if !check.verifyVersionf(check.pkg, call.Fun, go1_20, "unsafe.StringData") {
                        return
                }
 
index 68537355c3f3118f31b4ecc53481eb2c60996598..f03d9137a65d22a6c2b2017d4fad433cc74eb787 100644 (file)
@@ -31,7 +31,7 @@ func (check *Checker) funcInst(tsig *Signature, pos token.Pos, x *operand, ix *t
        } else {
                instErrPos = atPos(pos)
        }
-       versionErr := !check.allowVersionf(check.pkg, instErrPos, go1_18, "function instantiation")
+       versionErr := !check.verifyVersionf(check.pkg, instErrPos, go1_18, "function instantiation")
 
        // targs and xlist are the type arguments and corresponding type expressions, or nil.
        var targs []Type
@@ -297,7 +297,7 @@ func (check *Checker) callExpr(x *operand, call *ast.CallExpr) exprKind {
                // is an error checking its arguments (for example, if an incorrect number
                // of arguments is supplied).
                if got == want && want > 0 {
-                       check.allowVersionf(check.pkg, atPos(ix.Lbrack), go1_18, "function instantiation")
+                       check.verifyVersionf(check.pkg, atPos(ix.Lbrack), go1_18, "function instantiation")
 
                        sig = check.instantiateSignature(ix.Pos(), sig, targs, xlist)
                        assert(sig.TypeParams().Len() == 0) // signature is not generic anymore
@@ -508,7 +508,7 @@ func (check *Checker) arguments(call *ast.CallExpr, sig *Signature, targs []Type
                }
        }
        // at the moment we only support implicit instantiations of argument functions
-       _ = len(genericArgs) > 0 && check.allowVersionf(check.pkg, args[genericArgs[0]], go1_21, "implicitly instantiated function as argument")
+       _ = len(genericArgs) > 0 && check.verifyVersionf(check.pkg, args[genericArgs[0]], go1_21, "implicitly instantiated function as argument")
 
        // tparams holds the type parameters of the callee and generic function arguments, if any:
        // the first n type parameters belong to the callee, followed by mi type parameters for each
index 89022f0259985ae25dd9a6e1c645835658a96d88..4b7fb331c6208a59338a7d4229a35f9c933fc291 100644 (file)
@@ -561,7 +561,7 @@ func (check *Checker) typeDecl(obj *TypeName, tdecl *ast.TypeSpec, def *Named) {
                        check.validType(t)
                }
                // If typ is local, an error was already reported where typ is specified/defined.
-               _ = check.isImportedConstraint(rhs) && check.allowVersionf(check.pkg, tdecl.Type, go1_18, "using type constraint %s", rhs)
+               _ = check.isImportedConstraint(rhs) && check.verifyVersionf(check.pkg, tdecl.Type, go1_18, "using type constraint %s", rhs)
        }).describef(obj, "validType(%s)", obj.Name())
 
        alias := tdecl.Assign.IsValid()
@@ -574,7 +574,7 @@ func (check *Checker) typeDecl(obj *TypeName, tdecl *ast.TypeSpec, def *Named) {
 
        // alias declaration
        if alias {
-               check.allowVersionf(check.pkg, atPos(tdecl.Assign), go1_9, "type aliases")
+               check.verifyVersionf(check.pkg, atPos(tdecl.Assign), go1_9, "type aliases")
                check.brokenAlias(obj)
                rhs = check.typ(tdecl.Type)
                check.validAlias(obj, rhs)
index 5dba1f9d8bd084734631d0eecbb5126b309c5dda..0e4e6667d8063568598d24631d8763b2fd9c887c 100644 (file)
@@ -955,7 +955,7 @@ func (check *Checker) shift(x, y *operand, e ast.Expr, op token.Token) {
                // Check that RHS is otherwise at least of integer type.
                switch {
                case allInteger(y.typ):
-                       if !allUnsigned(y.typ) && !check.allowVersionf(check.pkg, y, go1_13, invalidOp+"signed shift count %s", y) {
+                       if !allUnsigned(y.typ) && !check.verifyVersionf(check.pkg, y, go1_13, invalidOp+"signed shift count %s", y) {
                                x.mode = invalid
                                return
                        }
index 52facdd02a6b6ff9b9f9b0065d83954ac3bff83b..6e175a7615c243c7ba25be5fb83830b310ab702f 100644 (file)
@@ -386,7 +386,7 @@ func (check *Checker) collectObjects() {
                                        check.declarePkgObj(name, obj, di)
                                }
                        case typeDecl:
-                               _ = d.spec.TypeParams.NumFields() != 0 && check.allowVersionf(pkg, d.spec.TypeParams.List[0], go1_18, "type parameter")
+                               _ = d.spec.TypeParams.NumFields() != 0 && check.verifyVersionf(pkg, d.spec.TypeParams.List[0], go1_18, "type parameter")
                                obj := NewTypeName(d.spec.Name.Pos(), pkg, d.spec.Name.Name, nil)
                                check.declarePkgObj(d.spec.Name, obj, &declInfo{file: fileScope, tdecl: d.spec})
                        case funcDecl:
@@ -442,7 +442,7 @@ func (check *Checker) collectObjects() {
                                        }
                                        check.recordDef(d.decl.Name, obj)
                                }
-                               _ = d.decl.Type.TypeParams.NumFields() != 0 && !hasTParamError && check.allowVersionf(pkg, d.decl.Type.TypeParams.List[0], go1_18, "type parameter")
+                               _ = d.decl.Type.TypeParams.NumFields() != 0 && !hasTParamError && check.verifyVersionf(pkg, d.decl.Type.TypeParams.List[0], go1_18, "type parameter")
                                info := &declInfo{file: fileScope, fdecl: d.decl}
                                // Methods are not package-level objects but we still track them in the
                                // object map so that we can handle them like regular functions (if the
index 330d15836509624d76ccc327aef1a04309606fd0..9489f6ae87b7b3f5f88c689c6f3ace1c8b289c02 100644 (file)
@@ -276,7 +276,7 @@ func computeInterfaceTypeSet(check *Checker, pos token.Pos, ityp *Interface) *_T
                        assert(!isTypeParam(typ))
                        tset := computeInterfaceTypeSet(check, pos, u)
                        // If typ is local, an error was already reported where typ is specified/defined.
-                       if check != nil && check.isImportedConstraint(typ) && !check.allowVersionf(check.pkg, atPos(pos), go1_18, "embedding constraint interface %s", typ) {
+                       if check != nil && check.isImportedConstraint(typ) && !check.verifyVersionf(check.pkg, atPos(pos), go1_18, "embedding constraint interface %s", typ) {
                                continue
                        }
                        comparable = tset.comparable
@@ -285,7 +285,7 @@ func computeInterfaceTypeSet(check *Checker, pos token.Pos, ityp *Interface) *_T
                        }
                        terms = tset.terms
                case *Union:
-                       if check != nil && !check.allowVersionf(check.pkg, atPos(pos), go1_18, "embedding interface element %s", u) {
+                       if check != nil && !check.verifyVersionf(check.pkg, atPos(pos), go1_18, "embedding interface element %s", u) {
                                continue
                        }
                        tset := computeUnionTypeSet(check, unionSets, pos, u)
@@ -299,7 +299,7 @@ func computeInterfaceTypeSet(check *Checker, pos token.Pos, ityp *Interface) *_T
                        if u == Typ[Invalid] {
                                continue
                        }
-                       if check != nil && !check.allowVersionf(check.pkg, atPos(pos), go1_18, "embedding non-interface type %s", typ) {
+                       if check != nil && !check.verifyVersionf(check.pkg, atPos(pos), go1_18, "embedding non-interface type %s", typ) {
                                continue
                        }
                        terms = termlist{{false, typ}}
index 54ffb3d3df8259611d200fc9eae9872ec275759d..8347e8ec76b3d9bb2e93aa52333d82dccb1b9352 100644 (file)
@@ -43,7 +43,7 @@ func (check *Checker) ident(x *operand, e *ast.Ident, def *Named, wantType bool)
                }
                return
        case universeAny, universeComparable:
-               if !check.allowVersionf(check.pkg, e, go1_18, "predeclared %s", e.Name) {
+               if !check.verifyVersionf(check.pkg, e, go1_18, "predeclared %s", e.Name) {
                        return // avoid follow-on errors
                }
        }
@@ -272,7 +272,7 @@ func (check *Checker) typInternal(e0 ast.Expr, def *Named) (T Type) {
 
        case *ast.IndexExpr, *ast.IndexListExpr:
                ix := typeparams.UnpackIndexExpr(e)
-               check.allowVersionf(check.pkg, inNode(e, ix.Lbrack), go1_18, "type instantiation")
+               check.verifyVersionf(check.pkg, inNode(e, ix.Lbrack), go1_18, "type instantiation")
                return check.instantiatedType(ix, def)
 
        case *ast.ParenExpr:
index 25b169d0d068351bf3ae382b7c0e0bf203f9f571..8962e2f06cbffa1aaa5e608ea168a8594363dd58 100644 (file)
@@ -141,9 +141,9 @@ func (check *Checker) allowVersion(pkg *Package, at positioner, v version) bool
        return check.version.equal(go0_0) || !check.version.before(v)
 }
 
-// allowVersionf is like allowVersion but also accepts a format string and arguments
+// verifyVersionf is like allowVersion but also accepts a format string and arguments
 // which are used to report a version error if allowVersion returns false.
-func (check *Checker) allowVersionf(pkg *Package, at positioner, v version, format string, args ...interface{}) bool {
+func (check *Checker) verifyVersionf(pkg *Package, at positioner, v version, format string, args ...interface{}) bool {
        if !check.allowVersion(pkg, at, v) {
                check.versionErrorf(at, v, format, args...)
                return false