Skip to content

Fix issue #22923: more sofisticated #23058

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

Closed
wants to merge 1 commit into from

Conversation

akhomchenko
Copy link
Contributor

Fixes #22923 but error message is more detailed.
Is an extension of #23050
I'm not sure which one will be ok.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 2, 2018

I think you should merge #23050 and this one in just one PR.

@@ -16420,6 +16426,14 @@ namespace ts {
return suggestion && symbolName(suggestion);
}

function typeHavingProperty(type: Type, property: __String, errorNode?: Node): Type | undefined {
const types: Type[] = (type.flags & TypeFlags.UnionOrIntersection)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not think you want to look in unions or intersections. if the promised type has the property then show the message.. not if one of the constituents of the union type has it.. since await will not fix this problem.

@akhomchenko akhomchenko mentioned this pull request Apr 2, 2018
@akhomchenko
Copy link
Contributor Author

Closed in favor of #23050

@akhomchenko akhomchenko closed this Apr 2, 2018
@akhomchenko akhomchenko deleted the fix/22923-option-2 branch April 2, 2018 21:01
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants