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 8, 2023
1 parent 60963e3 commit ee9d9f5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/icrate/tests/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(...)
}

0 comments on commit ee9d9f5

Please sign in to comment.