Browse Source

Add `init` and `copy` to all `Object`s

gingerBill 3 years ago
parent
commit
0e69993d39
1 changed files with 2 additions and 0 deletions
  1. 2 0
      vendor/darwin/Foundation/NSObject.odin

+ 2 - 0
vendor/darwin/Foundation/NSObject.odin

@@ -25,9 +25,11 @@ Copying :: struct($T: typeid) {using _: Object}
 alloc :: proc($T: typeid) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
 	return msgSend(^T, T, "alloc")
 }
+@(objc_type=Object, objc_name="init")
 init :: proc(self: ^$T) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
 	return msgSend(^T, self, "init")
 }
+@(objc_type=Object, objc_name="copy")
 copy :: proc(self: ^Copying($T)) -> ^T where intrinsics.type_is_subtype_of(T, Object) {
 	return msgSend(^T, self, "copy")
 }