-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 3.8.0-beta onwards
Search Terms: return, iife, error, flow anaylsis, try catch
Code
const x = (() => {
try { return 'x'; } catch (e) {
return null;
}
})();
// any code here is unreachable according to TSExpected behavior:
Typescript marks code as reachable
Actual behavior:
Typescript wrongfully assumes that any code after the block is unreachable
Related Issues:
None found
Some more info:
I initially found this issue in version 3.9.0-dev.2000215 but found it to also be present in 3.8.0-beta. It it not present in the current stable version (3.7.5).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue