Never type error in switch default #10600
Labels
Question
An issue which isn't directly actionable in code
Working as Intended
The behavior described is the intended behavior; this is not a bug
TypeScript Version: 2.0.0 beta
Code
Expected behavior:
Compile successful.
Actual behavior:
error TS2339: Property 'type' does not exist on type 'never'.
Can compile successfully without
default
Suggestion:
Well I know never type is a good way.
But in this case, value may be comes from a web API response.
So wanna add some protection code here, but get an error.
The text was updated successfully, but these errors were encountered: