aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormryouse2022-07-02 16:41:53 +0000
committermryouse2022-07-02 16:45:25 +0000
commit6240398ba91d17b08975a7157df1bf8c934cc145 (patch)
treef1f26766fca659b5043579c4d38bf888b7f0c452
parent4a8ee6f62f203f86a9ad3e15b3f46956e7915160 (diff)
bugfix: for a user defined type, add it to the dict
-rw-r--r--neb/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/neb/__init__.py b/neb/__init__.py
index 099bc2a..735e4db 100644
--- a/neb/__init__.py
+++ b/neb/__init__.py
@@ -215,4 +215,9 @@ class NebType(TypeWrap):
pass
class UserType(TypeWrap):
- pass
+
+ def __init__(self, name, parent, is_func):
+ if name in ALL_TYPES:
+ raise NebPanic(f"already a type called {name}")
+ ALL_TYPES[name] = Type(name)
+ super().__init__(name, parent, is_func)