diff options
| author | mryouse | 2022-07-12 01:39:44 +0000 |
|---|---|---|
| committer | mryouse | 2022-07-12 01:39:44 +0000 |
| commit | 7732a2a3f4d7171f253bf663d85006e8a69bea2a (patch) | |
| tree | 08e875d2a4faa70368b66ab15478ad7a4d54fd52 /neb/std | |
| parent | b71f1da5b5cf1c0b3f7f11759d73976856caec36 (diff) | |
bugfix: parent types can be typed lists
Diffstat (limited to 'neb/std')
| -rw-r--r-- | neb/std/core.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/neb/std/core.py b/neb/std/core.py index 9240b98..50a0c3e 100644 --- a/neb/std/core.py +++ b/neb/std/core.py @@ -224,15 +224,12 @@ def interpretType(symbol, args, env, ns): parent_type = evaluate(args[1], env, ns) if not isinstance(parent_type, TypeWrap): raise InterpretPanic(symbol, "parent must be a valid type", parent_type) - elif not env.contains(f"{parent_type}"): - raise InterpretPanic(symbol, f"no such type {parent_type}") - parent = env.get(f"{parent_type}") func = evaluate(args[2], env, ns) if not isinstance(func, Function): raise InterpretPanic(symbol, "validation must be a :func", func) - new_type = UserType(name, parent, func) + new_type = UserType(name, parent_type, func) env.register(name, new_type) return List([]) |
