To OP: You could avoid the visitor by using an IIFE style switch using the run utility fn:
export const run = <T>(f: () => T): T => f();
Now you can go: const inferred_type = run(() => {
switch(blah) {
...
}
})