use objc2::rc::{Allocated, Id, Shared};
use objc2::runtime::NSObject;
use objc2::{declare_class, ClassType};
trait GetSameType {
type SameType: ?Sized;
}
impl<T: ?Sized> GetSameType for T {
type SameType = T;
}
macro_rules! get_self {
() => {
Self
};
}
declare_class!(
struct MyTestObject;
unsafe impl ClassType for MyTestObject {
type Super = NSObject;
const NAME: &'static str = "MyTestObject";
}
unsafe impl MyTestObject {
#[method_id(init)]
fn init(
_this: Allocated<<Self as GetSameType>::SameType>,
_param: <*const Self as GetSameType>::SameType,
) -> Id<<Self as GetSameType>::SameType, Shared> {
unimplemented!()
}
#[method(compare:)]
fn compare(&self, _other: &Self) -> bool {
unimplemented!()
}
#[method_id(test4)]
#[allow(unused_parens)]
fn test4(_this: &<(Self) as GetSameType>::SameType) -> Id<get_self!(), Shared> {
unimplemented!()
}
}
);
fn main() {}