Skip to content

Commit 731f888

Browse files
committed
Disambiguate
1 parent 7a42f8e commit 731f888

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

objc2/src/macros.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ macro_rules! msg_send_id {
210210
$crate::__msg_send_inner! {
211211
@id NAME,
212212
$crate::__msg_send_inner! {
213-
@call <__Assert<ALLOC, INIT, RETAINED>>::__send_super_message_id($obj, $superclass, sel, ())
213+
@call <__Assert<ALLOC, INIT, RETAINED> as __MsgSendId<_, _>>::__send_super_message_id($obj, $superclass, sel, ())
214214
}
215215
}
216216
});
@@ -221,7 +221,7 @@ macro_rules! msg_send_id {
221221
$crate::__msg_send_inner! {
222222
@id NAME,
223223
$crate::__msg_send_inner! {
224-
@call <__Assert<ALLOC, INIT, RETAINED>>::__send_super_message_id($obj, $superclass, sel, ($($arg,)+))
224+
@call <__Assert<ALLOC, INIT, RETAINED> as __MsgSendId<_, _>>::__send_super_message_id($obj, $superclass, sel, ($($arg,)+))
225225
}
226226
}
227227
});
@@ -232,7 +232,7 @@ macro_rules! msg_send_id {
232232
$crate::__msg_send_inner! {
233233
@id NAME,
234234
$crate::__msg_send_inner! {
235-
@call <__Assert<ALLOC, INIT, RETAINED>>::__send_message_id($obj, sel, ())
235+
@call <__Assert<ALLOC, INIT, RETAINED> as __MsgSendId<_, _>>::__send_message_id($obj, sel, ())
236236
}
237237
}
238238
});
@@ -243,7 +243,7 @@ macro_rules! msg_send_id {
243243
$crate::__msg_send_inner! {
244244
@id NAME,
245245
$crate::__msg_send_inner! {
246-
@call <__Assert<ALLOC, INIT, RETAINED>>::__send_message_id($obj, sel, ($($arg,)+))
246+
@call <__Assert<ALLOC, INIT, RETAINED> as __MsgSendId<_, _>>::__send_message_id($obj, sel, ($($arg,)+))
247247
}
248248
}
249249
});
@@ -289,4 +289,20 @@ mod tests {
289289
assert!(!__starts_with_str(b"abcdef", b"abb"));
290290
assert!(!__starts_with_str(b"", b"a"));
291291
}
292+
293+
mod test_ {
294+
use super::*;
295+
296+
trait Abc {
297+
fn __send_message_id() {}
298+
}
299+
300+
impl<T> Abc for T {}
301+
302+
#[test]
303+
fn test_macro_still_works() {
304+
let cls = class!(NSObject);
305+
let _obj: Id<Object, Owned> = unsafe { msg_send_id![cls, new].unwrap() };
306+
}
307+
}
292308
}

0 commit comments

Comments
 (0)