fix for defaults in switch type

This commit is contained in:
əlemi 2021-12-11 06:01:14 +01:00
parent e24b05c982
commit 47fc4ee220

View file

@ -136,7 +136,7 @@ def mctype(slot_type:Any) -> Ref:
return Ref('SwitchType', return Ref('SwitchType',
v["compareTo"].split('/')[-1], v["compareTo"].split('/')[-1],
Ref(format_dict({int(k) if k.isnumeric() else repr(k):mctype(x) for k,x in v["fields"].items()}, depth=0)), Ref(format_dict({int(k) if k.isnumeric() else repr(k):mctype(x) for k,x in v["fields"].items()}, depth=0)),
v["default"] if "default" in v and v['default'] != 'void' else None, mctype(v["default"]) if "default" in v and v['default'] != 'void' else None,
) )
# return SwitchType(mctype(v)) # TODO # return SwitchType(mctype(v)) # TODO
elif t == "bitfield": elif t == "bitfield":