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

Check if element types of Promises contain a property when issuing a missing property error #22923

Closed
DanielRosenwasser opened this issue Mar 27, 2018 · 3 comments · Fixed by #23050
Labels
Domain: Error Messages The issue relates to error messaging Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

function f(x: Promise<string>) {
  x.toLowerCase()
}

Expected: Property 'toLowerCase' does not exist on type 'Promise<string>'. Did you forget to await the 'Promise<string>'?

Actual: Property 'toLowerCase' does not exist on type 'Promise<string>'.

@mhegazy mhegazy added Suggestion An idea for TypeScript Good First Issue Well scoped, documented and has the green light Help Wanted You can do this Domain: Error Messages The issue relates to error messaging labels Mar 28, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Mar 28, 2018

PRs welcomed. great first issue. will diffidently add value to our users.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 28, 2018

The follow up to this issue is to add a quick fix to add the await keyword.

@mhegazy mhegazy added this to the Community milestone Mar 28, 2018
@akhomchenko
Copy link
Contributor

I'll try to fix this.

akhomchenko added a commit to akhomchenko/TypeScript that referenced this issue Apr 1, 2018
akhomchenko added a commit to akhomchenko/TypeScript that referenced this issue Apr 1, 2018
akhomchenko added a commit to akhomchenko/TypeScript that referenced this issue Apr 1, 2018
akhomchenko added a commit to akhomchenko/TypeScript that referenced this issue Apr 2, 2018
akhomchenko added a commit to akhomchenko/TypeScript that referenced this issue Apr 2, 2018
akhomchenko added a commit to akhomchenko/TypeScript that referenced this issue Apr 2, 2018
akhomchenko added a commit to akhomchenko/TypeScript that referenced this issue Apr 3, 2018
akhomchenko added a commit to akhomchenko/TypeScript that referenced this issue Apr 5, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 6, 2018
@mhegazy mhegazy modified the milestones: Community, TypeScript 2.9 Apr 6, 2018
mhegazy added a commit that referenced this issue Apr 6, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Domain: Error Messages The issue relates to error messaging Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants