mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.regabi] cmd/compile: arrange for typecheck1 to end in switch
Ending typecheck1 in the switch makes it safe for each case to do an appropriate type assertion. The main change is dropping the computation of "ok" and using the syntax nodes themselves to decide what's OK. Passes buildall w/ toolstash -cmp. Change-Id: I2a1873a51e3f1194d74bb87a6653cb9857a02a1b Reviewed-on: https://go-review.googlesource.com/c/go/+/275444 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
dcc640e839
commit
ef5964dd6b
6 changed files with 195 additions and 175 deletions
|
|
@ -114,6 +114,8 @@ func NewFunc(pos src.XPos) *Func {
|
|||
return f
|
||||
}
|
||||
|
||||
func (f *Func) isStmt() {}
|
||||
|
||||
func (f *Func) Func() *Func { return f }
|
||||
func (f *Func) Body() Nodes { return f.body }
|
||||
func (f *Func) PtrBody() *Nodes { return &f.body }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue