+ return "TAG_Bool({global.attr_access}({recv})!=NIT_NULL) /* isset {local_class}::{name}*/"
+ end
+
+ # Compile a read acces on selffor a given reciever.
+ fun compile_read_access(v: CompilerVisitor, n: PNode, recv: String): String
+ do
+ var res = "{global.attr_access}({recv}) /*{local_class}::{name}*/"
+ if not signature.return_type.is_nullable then
+ res = v.ensure_var(res, "{local_class}::{name}")
+ v.add_instr("if ({res} == NIT_NULL) \{ fprintf(stderr, \"Uninitialized attribute %s\", \"{name}\"); {v.printf_locate_error(n)} nit_exit(1); } /* implicit isset */;")
+ end
+ return res
+ end
+
+ # Compile a write acces on selffor a given reciever.
+ fun compile_write_access(v: CompilerVisitor, n: nullable PNode, recv: String, value: String)
+ do
+ v.add_instr("{global.attr_access}({recv}) /*{local_class}::{name}*/ = {value};")