From 6240398ba91d17b08975a7157df1bf8c934cc145 Mon Sep 17 00:00:00 2001 From: mryouse Date: Sat, 2 Jul 2022 16:41:53 +0000 Subject: bugfix: for a user defined type, add it to the dict --- neb/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3