Repository navigation
noImplicitReturns does not take account of a never return #18841
Description
Activity
- addedIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
on Oct 1, 2017 DanielRosenwasser commented
on Oct 1, 2017 MemberMore actionsIf we did this, every single expression statement with a function call would need to tie into the control flow graph which would likely be prohibitively expensive, but we should discuss it anyway.
Ron Buckton (@rbuckton) started looking into expanding flow control analysis to allow it to operate for
throwexpressions in #18798, so we're already looking into it.Brian Terlson (@bterlson) mentioned a similar issue, wanting to be able to use
process.exit(), but I don't thinkneveris the correct type for this case.Reacted by Brian TerlsonThis is a duplicate of #10470. The main issue really here is how these two features are implemented. implicit return checks happen earlier in the binder. where as control flow analysis happens later on when we are checking. merging the two is not a trivial task.
- addedDuplicateAn existing issue was already createdAn existing issue was already createdand removedIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
on Oct 4, 2017 Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
ethanresnick commented
on Feb 12, 2018 ContributorMore actionsIs there a remaining open issue to track this? If not, should there be? I realize it's hard to implement, but maybe it's worth keeping open as a request? (#10470 has also been closed.)
RyanCavanaugh commented
on Feb 12, 2018 MemberMore actionsEthan Resnick (@ethanresnick) We'd prefer that open issues be actionable rather than serve as an infinite-scroll TODO list. Issues don't need to be open for us to be able to see activity on them
Reacted by Ethan Resnick- locked and limited conversation to collaborators
on Jul 3, 2018
TypeScript Version: 2.5.2
Code
Expected behavior:
Compiles without warnings when compiled with --noImplicitReturns
Actual behavior:
error TS7030: Not all code paths return a value.