if (expr == null) return false;
for (GoType type : expr.getType()) {
if (type == null) continue;
GoType underlyingType = type.underlyingType();
return underlyingType.accept(new TypeVisitor<Boolean>(false) {
@Override
public Boolean visitPrimitive(GoTypePrimitive type) {
return type.getType() == GoTypes.Builtin.Error;
}
});