Skip to content

Fix circular contextual return type error #17771

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

Merged
merged 2 commits into from
Aug 16, 2017
Merged

Conversation

ahejlsberg
Copy link
Member

With this PR, if obtaining the contextual type for a return statement or return expression would cause a circularity error (because the type depends on itself), we instead say there is no contextual type.

Fixes #17711.

@DanielRosenwasser
Copy link
Member

Looks good; can you also send a PR to the release-2.5 branch when you get the chance?

@ahejlsberg ahejlsberg merged commit ce2ac17 into master Aug 16, 2017
mhegazy added a commit that referenced this pull request Aug 24, 2017
* No contextual return type when type is circular

* Add regression test
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
@ahejlsberg ahejlsberg deleted the fixCircularContextualType branch May 24, 2019 13:57
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.

3 participants