def gen_slot_variable(self, cls: ClassDefinition, slotname: str) -> str:
slot = self.schema.slots[slotname]<EOL>if slot.alias:<EOL><INDENT>slotname = slot.alias<EOL><DEDENT>range_type = self.range_type_name(slot, cls.name)<EOL>if slot.inlined and slot.range in self.schema.classes and self.forward_reference(slot.range, cls.name):<EOL><INDENT>range_type = f'<STR_LIT>'<EOL><DEDENT>slot_range, default_val = self.range_cardinality(range_type, slot, cls)<EOL>default = f'<STR_LIT>' if default_val else '<STR_LIT>'<EOL>return f'''<STR_LIT>'''<EOL>
Generate a slot variable for slotname as defined in class