aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-11 15:50:24 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-11 15:50:24 +0000
commit346aa5f71ca4e3d6a71187024f809eaf2fc6da1b (patch)
treed61331a1bf713f66bcdba8816b8b01eef3e643b2 /src/check_stmt.c
parent73d6a55f5c96459d30eca5747d1458bcf6e9fec4 (diff)
Only check files that have been truly imported.
Diffstat (limited to 'src/check_stmt.c')
-rw-r--r--src/check_stmt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/check_stmt.c b/src/check_stmt.c
index 9067d1037..bbe254615 100644
--- a/src/check_stmt.c
+++ b/src/check_stmt.c
@@ -999,7 +999,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
}
- if (unparen_expr(lhs)->kind != AstNode_Ident) {
+ if (lhs->kind != AstNode_Ident) {
error_node(rhs, "Expected an identifier, got `%.*s`", LIT(ast_node_strings[rhs->kind]));
break;
}
@@ -1067,9 +1067,17 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
}
check_open_scope(c, stmt);
- if (case_type != NULL) {
- add_type_info_type(c, case_type);
+ if (case_type == NULL) {
+ if (is_union_ptr) {
+ case_type = type_deref(x.type);
+ } else {
+ case_type = x.type;
+ }
+ }
+
+ add_type_info_type(c, case_type);
+ {
// NOTE(bill): Dummy type
Type *tt = case_type;
if (is_union_ptr) {