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

Wrong checking return type from function #31235

Closed
snatvb opened this issue May 3, 2019 · 3 comments
Closed

Wrong checking return type from function #31235

snatvb opened this issue May 3, 2019 · 3 comments
Labels
Duplicate An existing issue was already created Fix Available A PR has been opened for this issue

Comments

@snatvb
Copy link

snatvb commented May 3, 2019

type A = {
  a: boolean;
}
type B = (v: A) => A

const c: B = (a) => {
  return { a: true, asd: 235 }
}

Why I don't have error?

But if I will write such code, then I get error:

const f = (v: A): A => {
  return { a: true, asd: 235 }
}
@jack-williams
Copy link
Collaborator

jack-williams commented May 3, 2019

Duplicate of #241/#29390/#30198. (The first issue might not look immediately related but it's the root cause).

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label May 3, 2019
@snatvb
Copy link
Author

snatvb commented May 6, 2019

@jack-williams how i understand, this problem will not be solved, becouse first post was in 2014, right?

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants