Commit 0d465821 authored by Alastair Robertson's avatar Alastair Robertson

Semantic analyser wait until final pass to declare invalid field accesses

parent ab16f8b7
......@@ -282,9 +282,11 @@ void SemanticAnalyser::visit(FieldAccess &acc)
acc.expr->accept(*this);
if (acc.expr->type.type != Type::cast) {
if (is_final_pass()) {
err_ << "Can not access field '" << acc.field
<< "' on expression of type '" << acc.expr->type
<< "'" << std::endl;
}
return;
}
......
......@@ -346,7 +346,7 @@ TEST(semantic_analyser, field_access_wrong_field)
TEST(semantic_analyser, field_access_wrong_expr)
{
test("kprobe:f { 1234->field }", 1);
test("kprobe:f { 1234->field }", 10);
}
TEST(semantic_analyser, field_access_types)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment