mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-01 02:42:09 +00:00
Add init and copy to all Objects
This commit is contained in:
2
vendor/darwin/Foundation/NSObject.odin
vendored
2
vendor/darwin/Foundation/NSObject.odin
vendored
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user