aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-02-26 22:53:40 +0000
committergingerBill <bill@gingerbill.org>2020-02-26 22:53:40 +0000
commit3d74c2f6c0797345c2bdfae77c619057227e8181 (patch)
tree4dd52d97f21a46b1ad6c57c9625344202bb7281d /src/check_type.cpp
parent1596bca92d4d8b3457cbfacec24e2a2129bba40e (diff)
Add `proc(#const x: Type)` to enforce a constant parameter (but not polymorphic) to a procedure
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 97b9985c8..6194951c9 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -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);