Skip to content

Commit 7c9ff46

Browse files
committed
Add test for broken behaviour
1 parent b5b79aa commit 7c9ff46

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/icrate/tests/set.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,16 @@ fn test_iter_minimal_retains() {
294294
expected.dealloc += 1;
295295
expected.assert_current();
296296
}
297+
298+
/// This currently works, but we should figure out a way to disallow it!
299+
#[test]
300+
#[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSConnection"))]
301+
#[allow(deprecated)]
302+
fn invalid_generic() {
303+
let something_interior_mutable = unsafe { Foundation::NSConnection::defaultConnection() };
304+
let set = NSSet::from_id_slice(&[Foundation::NSArray::from_id_slice(&[
305+
something_interior_mutable,
306+
])]);
307+
let _ = set.get_any().unwrap().get(0).unwrap();
308+
// something_interior_mutable.setAbc(...)
309+
}

0 commit comments

Comments
 (0)