Skip to content

Commit

Permalink
Add test for broken behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 10, 2023
1 parent 60963e3 commit cfb2b9d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/icrate/tests/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,16 @@ 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"))]
#[allow(deprecated)]
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(...)
}

0 comments on commit cfb2b9d

Please sign in to comment.