diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 15:25:33 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 15:25:33 -0400 |
| commit | 6622fb80892556ab9ada21846fbbf26d221bd0b0 (patch) | |
| tree | 0c4fee7ba46c71920f5d8ecd9c6745c6b769deb9 | |
| parent | e86813d9c1e363da269a8730c6b1fc620cf3ed2d (diff) | |
Bugfix for text method lookups
| -rw-r--r-- | environment.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/environment.c b/environment.c index 6ecb8652..4d883466 100644 --- a/environment.c +++ b/environment.c @@ -504,8 +504,9 @@ binding_t *get_namespace_binding(env_t *env, ast_t *self, const char *name) } case TextType: { auto text = Match(cls_type, TextType); - assert(text->env); - return get_binding(text->env, name); + env_t *text_env = text->env ? text->env : namespace_env(env, text->lang ? text->lang : "Text"); + assert(text_env); + return get_binding(text_env, name); } case StructType: { auto struct_ = Match(cls_type, StructType); |
