pyloxi: generate virtual class unpack methods
This is done completely from the IR now.
diff --git a/py_gen/templates/_ofclass.py b/py_gen/templates/_ofclass.py
index 610e5a8..c84ceea 100644
--- a/py_gen/templates/_ofclass.py
+++ b/py_gen/templates/_ofclass.py
@@ -42,3 +42,10 @@
def pretty_print(self, q):
:: include('_pretty_print.py', ofclass=ofclass)
+
+:: # Register with our superclass
+:: if ofclass.superclass:
+:: type_field_name = ofclass.superclass.discriminator.name
+:: type_value = ofclass.member_by_name(type_field_name).value
+${superclass_pyname}.subtypes[${type_value}] = ${ofclass.pyname}
+:: #endif