Add new shorthand

This commit is contained in:
gingerBill
2022-02-13 16:56:27 +00:00
parent 9dc83bc1b3
commit 2958c1d6aa
2 changed files with 29 additions and 21 deletions
+3
View File
@@ -31,6 +31,9 @@ copy :: proc(self: ^Copying($T)) -> ^T where intrinsics.type_is_subtype_of(T, Ob
return msgSend(^T, self, "copy")
}
new :: proc($T: typeid) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
return init(alloc(T))
}
@(objc_type=Object, objc_name="retain")
retain :: proc(self: ^Object) {