diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-25 17:36:10 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-25 17:36:10 +0100 |
| commit | c4081393c1ca0b1c259cdba572b32c266bc53c5c (patch) | |
| tree | a6c8b4e655b07a9d611199cb8d124c69069dde0e /src/check_expr.cpp | |
| parent | 1d81b73df9922f0d3006a2d8031bf44f88573224 (diff) | |
Fix typo for some built-in procedures
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index af2f2ad4c..4e2dc2e36 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -4160,7 +4160,7 @@ bool check_builtin_procedure(Checker *c, Operand *operand, AstNode *call, i32 id if (operand->mode == Addressing_Invalid || operand->mode == Addressing_Builtin) { return false; } - if (operand->type == NULL || operand->type == t_invalid) { + if (operand->type == NULL || operand->type == t_invalid || is_type_gen_proc(operand->type)) { error(operand->expr, "Invalid argument to `type_of_val`"); return false; } @@ -4183,8 +4183,8 @@ bool check_builtin_procedure(Checker *c, Operand *operand, AstNode *call, i32 id return false; } Type *t = o.type; - if (t == NULL || t == t_invalid) { - error(ce->args[0], "Invalid argument for `size_of`"); + if (t == NULL || t == t_invalid || is_type_gen_proc(operand->type)) { + error(ce->args[0], "Invalid argument for `type_info`"); return false; } t = default_type(t); |