} else {
msg = "missing method " + method.name
}
- check.errorf(pos, "%s cannot have dynamic type %s (%s)", x, T, msg)
+ if check.conf.CompilerErrorMessages {
+ check.errorf(pos, "impossible type assertion: %s (%s)", x, msg)
+ } else {
+ check.errorf(pos, "%s cannot have dynamic type %s (%s)", x, T, msg)
+ }
}
// expr typechecks expression e and initializes x with the expression value.
// of a type list (f.Name.Value == "type").
name := f.Name.Value
if name == "_" {
- check.errorf(f.Name, "invalid method name _")
+ if check.conf.CompilerErrorMessages {
+ check.errorf(f.Name, "methods must have a unique non-blank name")
+ } else {
+ check.errorf(f.Name, "invalid method name _")
+ }
continue // ignore
}