summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/types.c b/types.c
index 2c6c654..3188692 100644
--- a/types.c
+++ b/types.c
@@ -1307,6 +1307,9 @@ static bool types_expr(Typer *tr, Expression *e) {
if (param->flags & DECL_INFER) {
Value *val = &inferred_vals[i];
Type *type = &inferred_types[i];
+ /* if we have an inferred type argument, it shouldn't be flexible */
+ if (type->kind == TYPE_TYPE)
+ val->type->flags &= (TypeFlags)~(TypeFlags)TYPE_IS_FLEXIBLE;
param->val = *val;
param->type = *type;
param->flags |= DECL_FOUND_VAL | DECL_FOUND_TYPE;
@@ -1365,8 +1368,6 @@ static bool types_expr(Typer *tr, Expression *e) {
if (fn_type->constness) {
bool instance_already_exists;
c->instance = instance_table_adda(tr->allocr, &original_fn->instances, table_index, &table_index_type, &instance_already_exists);
-
-
if (instance_already_exists) {
arr_cleara(&table_index_type.tuple, tr->allocr);
arr_cleara(&table_index.tuple, tr->allocr);