]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] go/types, types2: remove instance.verify field (cleanup)
authorRobert Griesemer <gri@golang.org>
Wed, 28 Jul 2021 21:01:06 +0000 (14:01 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 29 Jul 2021 19:46:12 +0000 (19:46 +0000)
This field is not needed anymore.
Follow-up on CL 335978 and CL 338097.

Change-Id: I8032e5153ba65c6a4aaf6575ac6d5a15a61f1b81
Reviewed-on: https://go-review.googlesource.com/c/go/+/338098
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/instance.go
src/cmd/compile/internal/types2/instantiate.go
src/go/types/instance.go
src/go/types/instantiate.go

index 711d7de53cac9c723db9b898bbef0644c2fb7a5a..e18688771cca4007d76f0029e746e6a2fb87f6b7 100644 (file)
@@ -15,7 +15,6 @@ import "cmd/compile/internal/syntax"
 type instance struct {
        pos     syntax.Pos   // position of type instantiation; for error reporting only
        posList []syntax.Pos // position of each targ; for error reporting only
-       verify  bool         // if set, check constraint satisfaction upon instantiation
 }
 
 // expand ensures that the underlying type of n is instantiated.
index 7a40cea88942263bc1af386f823c38561e4110f6..ee790ba6d6b4b518173ef31813c6e0f5091e901e 100644 (file)
@@ -127,15 +127,11 @@ func (check *Checker) InstantiateLazy(pos syntax.Pos, typ Type, targs []Type, po
        tname := NewTypeName(pos, base.obj.pkg, base.obj.name, nil)
        named := check.newNamed(tname, base, nil, nil, nil) // methods and tparams are set when named is loaded.
        named.targs = targs
-       named.instance = &instance{
-               pos:     pos,
-               posList: posList,
-               verify:  verify,
-       }
-
+       named.instance = &instance{pos, posList}
        if check != nil {
                check.typMap[h] = named
        }
+
        return named
 }
 
index 7e158ea35217d93af14a2251acab433a32556273..5e0447b43417751574e1e79cf9ed17feb415ba5c 100644 (file)
@@ -14,7 +14,6 @@ type instance struct {
        check   *Checker
        pos     token.Pos   // position of type instantiation; for error reporting only
        posList []token.Pos // position of each targ; for error reporting only
-       verify  bool        // if set, constraint satisfaction is verified
 }
 
 // complete ensures that the underlying type of n is instantiated.
index 7e2f3173c3f143540f32bfcd54c864cb7114134f..1d3bbc26671954d221d748ade17107fd0b2f4873 100644 (file)
@@ -124,15 +124,11 @@ func (check *Checker) InstantiateLazy(pos token.Pos, typ Type, targs []Type, pos
        tname := NewTypeName(pos, base.obj.pkg, base.obj.name, nil)
        named := check.newNamed(tname, base, nil, base.TParams(), base.methods) // methods are instantiated lazily
        named.targs = targs
-       named.instance = &instance{
-               check:   check,
-               pos:     pos,
-               posList: posList,
-               verify:  verify,
-       }
+       named.instance = &instance{check, pos, posList}
        if check != nil {
                check.typMap[h] = named
        }
+
        return named
 }