aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-05-25 14:49:36 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-05-25 14:49:36 -0400
commita43b807ef3775f2cc0440b1b07c6bc2b8c523e8a (patch)
tree8bf2439c49aa394741a3d87d7822cc08c682147c /src
parentc48f08ed0ee6f7054084e366cfa5fad2a51bac53 (diff)
Add extra check to make sure extend is extending a type and not
something else
Diffstat (limited to 'src')
-rw-r--r--src/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compile.c b/src/compile.c
index 89cb667b..e5d0e0ec 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -4384,7 +4384,7 @@ CORD compile_top_level_code(env_t *env, ast_t *ast)
case Extend: {
DeclareMatch(extend, ast, Extend);
binding_t *b = get_binding(env, extend->name);
- if (!b)
+ if (!b || b->type->tag != TypeInfoType)
code_err(ast, "'", extend->name, "' is not the name of any type I recognize.");
env_t *ns_env = Match(b->type, TypeInfoType)->env;
env_t *extended = new(env_t);