Appreciate the answer above does appear to fix the issue, but this isn't really an ideal solution, and doesn't help us understand how we should be using transformers really.
Specifically I feel like there's code smell around type erasure as a solution here, given that we're dealing with Foundation objects.
Post
Replies
Boosts
Views
Activity
Have a similar issue (same error) just using CoreData with a transformable attribute with a NSSecureUnarchiveFromDataTransformer transformer and a Custom Class of Set<String>.
Frustratingly this error happens in some unit tests, but not consistently. Using NSSet appears to be working for the moment, but I'm not confident that it's gone unless I can reproduce the issue consistently.