Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The : never function, does not recognize another : never function it its body #17408

Closed
parzh opened this issue Jul 25, 2017 · 1 comment
Closed
Labels
Duplicate An existing issue was already created

Comments

@parzh
Copy link

parzh commented Jul 25, 2017

TypeScript Version: 2.4.1

Code:

function foo(): never {
  throw new Error();
}


function bar(): never {
  foo(); // there's no reachable end point here
}

Expected behavior:
No compiler errors / warnings, since type annotation is present on function foo

Actual behavior:
Compiler: [ts] A function returning 'never' cannot have a reachable end point.

@RyanCavanaugh
Copy link
Member

Duplicate of #14735 and its related issues

@RyanCavanaugh RyanCavanaugh marked this as a duplicate of #14735 Jul 25, 2017
@parzh parzh closed this as completed Jul 25, 2017
@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jul 25, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

1 participant