From c4081393c1ca0b1c259cdba572b32c266bc53c5c Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 25 Jun 2017 17:36:10 +0100 Subject: Fix typo for some built-in procedures --- src/check_expr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/check_expr.cpp') 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); -- cgit v1.2.3