diff --git a/crates/icrate/tests/set.rs b/crates/icrate/tests/set.rs index 5f3d5ca6a..86deb435a 100644 --- a/crates/icrate/tests/set.rs +++ b/crates/icrate/tests/set.rs @@ -294,3 +294,15 @@ fn test_iter_minimal_retains() { expected.dealloc += 1; expected.assert_current(); } + +/// This currently works, but we should figure out a way to disallow it! +#[test] +#[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSConnection"))] +fn invalid_generic() { + let something_interior_mutable = unsafe { Foundation::NSConnection::defaultConnection() }; + let set = NSSet::from_id_slice(&[Foundation::NSArray::from_id_slice(&[ + something_interior_mutable, + ])]); + let _ = set.get_any().unwrap().get(0).unwrap(); + // something_interior_mutable.setAbc(...) +}