Treat class instance access as a normal error.

Normally, it will happen only as a follow-on error, but I can think of a
way to force it without other errors, so treating it as an internal error
is a bit harsh.
This commit is contained in:
Bill Currie 2012-12-23 06:01:20 +09:00
parent 996b2734a4
commit aae0e21a5b

View file

@ -1040,7 +1040,9 @@ field_expr (expr_t *e1, expr_t *e2)
return unary_expr ('.', e);
}
} else if (obj_is_class (t1)) {
internal_error (e1, "access to class instances not implemented");
//Class instance variables aren't allowed and thus declaring one
//is treated as an error, so this is a follow-on error.
return error (e1, "class instance access");
}
return type_mismatch (e1, e2, '.');
}