diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 23:31:36 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 23:31:36 -0400 |
| commit | 9e07c6adc7a0616eec40e78024a8501ec7d96559 (patch) | |
| tree | 92542ba27e13152a8305deb6f0cda3a952ac8835 /typecheck.c | |
| parent | 1f16d63ac783d9b1bb1d4a65676476d14f0af713 (diff) | |
Add Channel:peek()
Diffstat (limited to 'typecheck.c')
| -rw-r--r-- | typecheck.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c index 805f83e0..2fb8556d 100644 --- a/typecheck.c +++ b/typecheck.c @@ -774,6 +774,7 @@ type_t *get_type(env_t *env, ast_t *ast) else if (streq(call->name, "get")) return Match(self_value_t, ChannelType)->item_type; else if (streq(call->name, "give")) return Type(VoidType); else if (streq(call->name, "give_all")) return Type(VoidType); + else if (streq(call->name, "peek")) return Match(self_value_t, ChannelType)->item_type; else if (streq(call->name, "view")) return Type(ArrayType, .item_type=Match(self_value_t, ChannelType)->item_type); else code_err(ast, "There is no '%s' method for arrays", call->name); } |
