From: Jes Cok Date: Fri, 21 Nov 2025 15:51:03 +0000 (+0000) Subject: cmd/compile/internal/devirtualize: fix typos X-Git-Tag: go1.26rc1~214 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b9d86baae34197004a175c5c02b901240056a250;p=gostls13.git cmd/compile/internal/devirtualize: fix typos Change-Id: I4f5a89f452a252018072d067da4cdb9a6cb0f4fe GitHub-Last-Rev: 7eb108d3878109ccb9846d97b2adc7ea3003772a GitHub-Pull-Request: golang/go#76396 Reviewed-on: https://go-review.googlesource.com/c/go/+/722860 Reviewed-by: Keith Randall Reviewed-by: Robert Griesemer LUCI-TryBot-Result: Go LUCI Auto-Submit: Robert Griesemer --- diff --git a/src/cmd/compile/internal/devirtualize/devirtualize.go b/src/cmd/compile/internal/devirtualize/devirtualize.go index cb4608a024..5f1da23654 100644 --- a/src/cmd/compile/internal/devirtualize/devirtualize.go +++ b/src/cmd/compile/internal/devirtualize/devirtualize.go @@ -131,7 +131,7 @@ func StaticCall(s *State, call *ir.CallExpr) { // type assertion that we make here would also have failed, but with a different // panic "pkg.Iface is nil, not *pkg.Impl", where previously we would get a nil panic. // We fix this, by introducing an additional nilcheck on the itab. - // Calling a method on an nil interface (in most cases) is a bug in a program, so it is fine + // Calling a method on a nil interface (in most cases) is a bug in a program, so it is fine // to devirtualize and further (possibly) inline them, even though we would never reach // the called function. dt.UseNilPanic = true @@ -197,7 +197,7 @@ var noType types.Type // concreteType1 analyzes the node n and returns its concrete type if it is statically known. // Otherwise, it returns a nil Type, indicating that a concrete type was not determined. -// When n is known to be statically nil or a self-assignment is detected, in returns a sentinel [noType] type instead. +// When n is known to be statically nil or a self-assignment is detected, it returns a sentinel [noType] type instead. func concreteType1(s *State, n ir.Node, seen map[*ir.Name]struct{}) (outT *types.Type) { nn := n // for debug messages @@ -310,7 +310,7 @@ func concreteType1(s *State, n ir.Node, seen map[*ir.Name]struct{}) (outT *types // assignment can be one of: // - nil - assignment from an interface type. // - *types.Type - assignment from a concrete type (non-interface). -// - ir.Node - assignment from a ir.Node. +// - ir.Node - assignment from an ir.Node. // // In most cases assignment should be an [ir.Node], but in cases where we // do not follow the data-flow, we return either a concrete type (*types.Type) or a nil. @@ -560,8 +560,8 @@ func (s *State) analyze(nodes ir.Nodes) { assign(n.Key, nil) assign(n.Value, nil) } else { - // We will not reach here in case of an range-over-func, as it is - // rewrtten to function calls in the noder package. + // We will not reach here in case of a range-over-func, as it is + // rewritten to function calls in the noder package. base.FatalfAt(n.Pos(), "range over unexpected type %v", n.X.Type()) } case ir.OSWITCH: