Yes. You can define your sealed classes in a nested fashion if you wanted to more tightly namespace the classes.
Using the sealed class hierarchy in a when
expression should still work as expected by providing the string typing checks and warning that not all cases are covered.