//
// var do func(ir.Node) bool
// do = func(x ir.Node) bool {
-// ... processing BEFORE visting children ...
+// ... processing BEFORE visiting children ...
// if ... should visit children ... {
// ir.DoChildren(x, do)
-// ... processing AFTER visting children ...
+// ... processing AFTER visiting children ...
// }
// if ... should stop parent DoChildren call from visiting siblings ... {
// return true
//
// var do func(ir.Node) bool
// do = func(x ir.Node) bool {
-// ... processing BEFORE visting children ...
+// ... processing BEFORE visiting children ...
// if ... should visit children ... {
// ir.DoChildren(x, do)
// }
-// ... processing AFTER visting children ...
+// ... processing AFTER visiting children ...
// return false
// }
// do(root)
x.expr = inst
return
}
- // all type arguments were inferred sucessfully
+ // all type arguments were inferred successfully
if debug {
for _, targ := range targs {
assert(targ != nil)
return
}
}
- // all type arguments were inferred sucessfully
+ // all type arguments were inferred successfully
if debug {
for _, targ := range targs {
assert(targ != nil)
}
// goTypeName returns the Go type name for typ and
-// removes any occurences of "types." from that name.
+// removes any occurrences of "types." from that name.
func goTypeName(typ Type) string {
return strings.Replace(fmt.Sprintf("%T", typ), "types.", "", -1) // strings.ReplaceAll is not available in Go 1.4
}
}
// typeList provides the list of types corresponding to the incoming expression list.
-// If an error occured, the result is nil, but all list elements were type-checked.
+// If an error occurred, the result is nil, but all list elements were type-checked.
func (check *Checker) typeList(list []syntax.Expr) []Type {
res := make([]Type, len(list)) // res != nil even if len(list) == 0
for i, x := range list {
x.expr = inst
return
}
- // all type arguments were inferred sucessfully
+ // all type arguments were inferred successfully
if debug {
for _, targ := range targs {
assert(targ != nil)
return
}
}
- // all type arguments were inferred sucessfully
+ // all type arguments were inferred successfully
if debug {
for _, targ := range targs {
assert(targ != nil)
// We accept parenthesized embedded struct fields so we can distinguish between
// a named field with a parenthesized type foo (T) and an embedded parameterized
-// type (foo(T)), similarly to interace embedding.
+// type (foo(T)), similarly to interface embedding.
// They still need to be valid embedded types after the parentheses are stripped
// (i.e., in contrast to interfaces, we cannot embed a struct literal). The name
// of the embedded field is derived as before, after stripping parentheses.
}
// goTypeName returns the Go type name for typ and
-// removes any occurences of "types." from that name.
+// removes any occurrences of "types." from that name.
func goTypeName(typ Type) string {
return strings.ReplaceAll(fmt.Sprintf("%T", typ), "types.", "")
}
}
// typeList provides the list of types corresponding to the incoming expression list.
-// If an error occured, the result is nil, but all list elements were type-checked.
+// If an error occurred, the result is nil, but all list elements were type-checked.
func (check *Checker) typeList(list []ast.Expr) []Type {
res := make([]Type, len(list)) // res != nil even if len(list) == 0
for i, x := range list {
// Stack-assigned return values do not share
// space with arguments like they do with registers,
// so we need to inject a stack offset here.
- // Fake it by artifically extending stackBytes by
+ // Fake it by artificially extending stackBytes by
// the return offset.
out.stackBytes = retOffset
for i, res := range t.out() {
}
childOutput, err = ioutil.ReadFile(childDumpPath)
if err != nil {
- t.Fatalf("reading child ouput failed: %v", err)
+ t.Fatalf("reading child output failed: %v", err)
}
if got, want := string(childOutput), fmt.Sprintf("%d", parent.Process.Pid); got != want {
t.Fatalf("child output: want %q, got %q", want, got)
// up and running against the existing test cases. The explicitly
// listed files don't pass yet, usually because the error messages
// are slightly different (this list is not complete). Any errorcheck
- // tests that require output from analysis phases past intial type-
+ // tests that require output from analysis phases past initial type-
// checking are also excluded since these phases are not running yet.
// We can get rid of this code once types2 is fully plugged in.