From 6622fb80892556ab9ada21846fbbf26d221bd0b0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 3 Sep 2024 15:25:33 -0400 Subject: [PATCH] Bugfix for text method lookups --- environment.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/environment.c b/environment.c index 6ecb865..4d88346 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);