[dev.typeparams] go/types, types2: remove instance.verify field (cleanup)

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>
This commit is contained in:
Robert Griesemer 2021-07-28 14:01:06 -07:00
parent c079b6baaa
commit af903261e7
4 changed files with 4 additions and 14 deletions

View file

@ -15,7 +15,6 @@ import "cmd/compile/internal/syntax"
type instance struct { type instance struct {
pos syntax.Pos // position of type instantiation; for error reporting only pos syntax.Pos // position of type instantiation; for error reporting only
posList []syntax.Pos // position of each targ; 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. // expand ensures that the underlying type of n is instantiated.

View 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) 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 := check.newNamed(tname, base, nil, nil, nil) // methods and tparams are set when named is loaded.
named.targs = targs named.targs = targs
named.instance = &instance{ named.instance = &instance{pos, posList}
pos: pos,
posList: posList,
verify: verify,
}
if check != nil { if check != nil {
check.typMap[h] = named check.typMap[h] = named
} }
return named return named
} }

View file

@ -14,7 +14,6 @@ type instance struct {
check *Checker check *Checker
pos token.Pos // position of type instantiation; for error reporting only pos token.Pos // position of type instantiation; for error reporting only
posList []token.Pos // position of each targ; 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. // complete ensures that the underlying type of n is instantiated.

View 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) 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 := check.newNamed(tname, base, nil, base.TParams(), base.methods) // methods are instantiated lazily
named.targs = targs named.targs = targs
named.instance = &instance{ named.instance = &instance{check, pos, posList}
check: check,
pos: pos,
posList: posList,
verify: verify,
}
if check != nil { if check != nil {
check.typMap[h] = named check.typMap[h] = named
} }
return named return named
} }