(
ir: ClassIR, attr_name: str, attr_rtype: RType, module_name: str
)
| 630 | |
| 631 | |
| 632 | def add_getter_declaration( |
| 633 | ir: ClassIR, attr_name: str, attr_rtype: RType, module_name: str |
| 634 | ) -> None: |
| 635 | self_arg = RuntimeArg("self", RInstance(ir), pos_only=True) |
| 636 | sig = FuncSignature([self_arg], attr_rtype) |
| 637 | decl = FuncDecl(attr_name, ir.name, module_name, sig, FUNC_NORMAL) |
| 638 | decl.is_prop_getter = True |
| 639 | decl.implicit = True # Triggers synthesization |
| 640 | ir.method_decls[attr_name] = decl |
| 641 | ir.property_types[attr_name] = attr_rtype # TODO: Needed?? |
| 642 | |
| 643 | |
| 644 | def add_setter_declaration( |
no test coverage detected
searching dependent graphs…