aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-05-27 11:47:21 +0100
committerGinger Bill <bill@gingerbill.org>2017-05-27 11:47:21 +0100
commit45dbe8d354a776dfc526f5a31b9f49158640e45b (patch)
treed969f52d52132704c996ddc90a9e7bbf134d845a /src/check_expr.c
parentddb99dd638f213275a921ab28f491e1948f59770 (diff)
`default:` to `case:`; `no_alias` to `#no_alias`
Diffstat (limited to 'src/check_expr.c')
-rw-r--r--src/check_expr.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/check_expr.c b/src/check_expr.c
index dc98b1bc7..27659c800 100644
--- a/src/check_expr.c
+++ b/src/check_expr.c
@@ -1313,8 +1313,8 @@ Entity *check_ident(Checker *c, Operand *o, AstNode *n, Type *named_type, Type *
}
break;
+ case Entity_TypeAlias:
case Entity_TypeName:
- // NOTE(bill): Cyclical dependency checking is handled in the "type system" not here
o->mode = Addressing_Type;
break;
@@ -1344,17 +1344,6 @@ Entity *check_ident(Checker *c, Operand *o, AstNode *n, Type *named_type, Type *
o->mode = Addressing_Value;
break;
- case Entity_Alias: {
- // error_node(n, "#alias entities are not yet supported");
- // TODO(bill): Fix Entity_Alias rules
- if (e->Alias.kind == EntityAlias_Type) {
- o->mode = Addressing_Type;
- } else {
- o->mode = Addressing_Invalid;
- return e;
- }
- } break;
-
default:
compiler_error("Unknown EntityKind");
break;
@@ -3070,10 +3059,6 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
expr_entity = e;
Entity *original_e = e;
- while (e != NULL && e->kind == Entity_Alias && e->Alias.original != NULL) {
- e = e->Alias.original;
- }
-
if (e != NULL && e->kind == Entity_ImportName && selector->kind == AstNode_Ident) {
// IMPORTANT NOTE(bill): This is very sloppy code but it's also very fragile
// It pretty much needs to be in this order and this way
@@ -3295,6 +3280,7 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
operand->mode = Addressing_Value;
}
break;
+ case Entity_TypeAlias:
case Entity_TypeName:
operand->mode = Addressing_Type;
break;
@@ -3306,11 +3292,6 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
operand->builtin_id = entity->Builtin.id;
break;
- case Entity_Alias: {
- error_node(selector, "#alias entities are not yet supported");
- return NULL;
- } break;
-
// NOTE(bill): These cases should never be hit but are here for sanity reasons
case Entity_Nil:
operand->mode = Addressing_Value;