aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-10-31 20:17:50 +0000
committergingerBill <bill@gingerbill.org>2019-10-31 20:17:50 +0000
commit01dfb1dac8b71b2b84bb585395063c52779f5674 (patch)
treeec706e8565e1e4004f9ab97e31f0de74a869fecc /src/check_expr.cpp
parentee8d3e03f89b1f8065fc9563d84830482bc3f387 (diff)
Fix double calling of lhs of logical binary expressions
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 51497af7e..8612167c9 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -62,7 +62,7 @@ Type * make_optional_ok_type (Type *value);
void check_type_decl (CheckerContext *c, Entity *e, Ast *type_expr, Type *def);
Entity * check_selector (CheckerContext *c, Operand *operand, Ast *node, Type *type_hint);
Entity * check_ident (CheckerContext *c, Operand *o, Ast *n, Type *named_type, Type *type_hint, bool allow_import_name);
-Entity * find_polymorphic_record_entity (CheckerContext *c, Type *original_type, isize param_count, Array<Operand> ordered_operands);
+Entity * find_polymorphic_record_entity (CheckerContext *c, Type *original_type, isize param_count, Array<Operand> const &ordered_operands, bool *failure);
void check_not_tuple (CheckerContext *c, Operand *operand);
void convert_to_typed (CheckerContext *c, Operand *operand, Type *target_type);
gbString expr_to_string (Ast *expression);
@@ -6336,12 +6336,16 @@ CallArgumentError check_polymorphic_record_type(CheckerContext *c, Operand *oper
{
gbAllocator a = c->allocator;
- Entity *found_entity = find_polymorphic_record_entity(c, original_type, param_count, ordered_operands);
+ bool failure = false;
+ Entity *found_entity = find_polymorphic_record_entity(c, original_type, param_count, ordered_operands, &failure);
if (found_entity) {
operand->mode = Addressing_Type;
operand->type = found_entity->type;
return err;
}
+ if (failure) {
+ return CallArgumentError_NoneConstantParameter;
+ }
String generated_name = make_string_c(expr_to_string(call));