Comment Comment by domlebo70 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) { ... } }) parent domlebo70 3 years ago