Correctly handling nested records, allowing redefinition of the same enum