]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/devirtualize: fix typos
authorJes Cok <xigua67damn@gmail.com>
Fri, 21 Nov 2025 15:51:03 +0000 (15:51 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 21 Nov 2025 17:33:16 +0000 (09:33 -0800)
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 <khr@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>

src/cmd/compile/internal/devirtualize/devirtualize.go

index cb4608a024657453bee664295de46b3f19482de3..5f1da236545ac4aeef0acee94c982fa9f16c2a3f 100644 (file)
@@ -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: