pkg/objc: properties

This commit is contained in:
Mitchell Hashimoto
2022-10-25 21:25:07 -07:00
parent aaaae38fa1
commit 59cb774cdd
5 changed files with 84 additions and 6 deletions

View File

@@ -29,7 +29,10 @@ pub fn MsgSend(comptime T: type) type {
// This lets msgSend magically work with Object and so on.
const is_pkg_struct = comptime is_pkg_struct: {
for (@typeInfo(objc).Struct.decls) |decl| {
if (decl.is_pub and Return == @field(objc, decl.name)) {
if (decl.is_pub and
@TypeOf(@field(objc, decl.name)) == type and
Return == @field(objc, decl.name))
{
break :is_pkg_struct true;
}
}