2 ms·
> Do most (or any) languages in which people take this approach actually enforce handling of all cases? Or could a programmer write that this way: [...] Any la
by eyelidlessness 6y ago
> Do most (or any) languages in which people take this approach actually enforce handling of all cases? Or could a programmer write that this way: [...]
Any language that provides this sort of union type will error in some way if you try to access something that isn’t guaranteed to be on every type in the union. Some languages which support null checking will infer Customer to be nullable.