I'm working on a system where all ids are represented by strings, but that has an issue where you can get different data's ids mixed up (eg a cat and dog each have an id, but with just strings you could set cat.id = dog.id which would be incorrect).
I know I can make a type alias to make this clearer (eg, CatId and DogId will at least be clearer), but this still doesn't prevent assigning them.
Is there any way to make a new type that cannot be directly assigned from another type, even if they're both strings internally? (without resorting to wrapper objects)