From 7580ec494b144d85bf96af114d32fc60f0f8c0ad Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 30 Mar 2019 10:43:53 +0000 Subject: Disallow ambiguous singularly variadic polymorphic parameters #361 --- src/check_type.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/check_type.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index 1721ed881..22cd409ee 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1570,6 +1570,12 @@ Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_params, bool *is if (operands != nullptr && variables.count < operands->count) { Operand op = (*operands)[variables.count]; + if (op.expr == nullptr) { + // NOTE(bill): 2019-03-30 + // This is just to add the error message to determine_type_from_polymorphic which + // depends on valid position information + op.expr = _params; + } if (is_type_polymorphic_type) { type = determine_type_from_polymorphic(ctx, type, op); if (type == t_invalid) { -- cgit v1.2.3