func TestCheck(t *testing.T) {
DefPredeclaredTestFuncs()
- testDirFiles(t, "../../../../internal/types/testdata/check", 55, false) // TODO(gri) narrow column tolerance
+ testDirFiles(t, "../../../../internal/types/testdata/check", 50, false) // TODO(gri) narrow column tolerance
}
func TestSpec(t *testing.T) { testDirFiles(t, "../../../../internal/types/testdata/spec", 0, false) }
func TestExamples(t *testing.T) {
hasTParamError = true
}
if t := s.Type; len(t.ParamList) != 0 || len(t.ResultList) != 0 {
- check.softErrorf(s, "func %s must have no arguments and no return values", name)
+ check.softErrorf(s.Name, "func %s must have no arguments and no return values", name)
}
}
// don't declare init functions in the package scope - they are invisible
}
if t := d.decl.Type; t.Params.NumFields() != 0 || t.Results != nil {
// TODO(rFindley) Should this be a hard error?
- check.softErrorf(d.decl, code, "func %s must have no arguments and no return values", name)
+ check.softErrorf(d.decl.Name, code, "func %s must have no arguments and no return values", name)
}
}
if name == "init" {
// Initialization functions
func init() {}
-func /* ERROR "no arguments and no return values" */ init(int) {}
-func /* ERROR "no arguments and no return values" */ init() int { return 0 }
-func /* ERROR "no arguments and no return values" */ init(int) int { return 0 }
+func init /* ERROR "no arguments and no return values" */ (int) {}
+func init /* ERROR "no arguments and no return values" */ () int { return 0 }
+func init /* ERROR "no arguments and no return values" */ (int) int { return 0 }
func (T) init(int) int { return 0 }
package main
func main()
-func /* ERROR "no arguments and no return values" */ main /* ERROR redeclared */ (int)
-func /* ERROR "no arguments and no return values" */ main /* ERROR redeclared */ () int
+func main /* ERROR "no arguments and no return values" */ /* ERROR redeclared */ (int)
+func main /* ERROR "no arguments and no return values" */ /* ERROR redeclared */ () int