Add proc(#const x: Type) to enforce a constant parameter (but not polymorphic) to a procedure

This commit is contained in:
gingerBill
2020-02-26 22:53:40 +00:00
parent 1596bca92d
commit 3d74c2f6c0
5 changed files with 33 additions and 2 deletions
+4 -1
View File
@@ -1722,8 +1722,11 @@ Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_params, bool *is
if (p->flags&FieldFlag_auto_cast) {
param->flags |= EntityFlag_AutoCast;
}
param->state = EntityState_Resolved; // NOTE(bill): This should have be resolved whilst determining it
if (p->flags&FieldFlag_const) {
param->flags |= EntityFlag_ConstInput;
}
param->state = EntityState_Resolved; // NOTE(bill): This should have be resolved whilst determining it
add_entity(ctx->checker, scope, name, param);
if (is_using) {
add_entity_use(ctx, name, param);