Skip to content

Fixing bugs in C# TypeInferrer#30211

Merged
sharwell merged 20 commits intodotnet:masterfrom
Neme12:typeInferrer
Oct 17, 2018
Merged

Fixing bugs in C# TypeInferrer#30211
sharwell merged 20 commits intodotnet:masterfrom
Neme12:typeInferrer

Conversation

@Neme12
Copy link
Copy Markdown
Contributor

@Neme12 Neme12 commented Sep 28, 2018

This PR simplifies the C# TypeInferrer and fixes 3 bugs along the way. The vast majority of additions are new tests. Can be reviewed commit by commit to see more granular changes and each of the 3 fixes individually.

Fixes #30232
Fixes #30235
Fixes #27647

@Neme12 Neme12 requested a review from a team as a code owner September 28, 2018 12:46
It seems that removing it doesn't cause any failures, so the branch is currently untested. Adding 2 enum completion tests which would now fail if the condition was removed (NotInSimpleLambdaAfterAsync and NotInParenthesizedLambdaAfterAsync) + a few other tests.
@jinujoseph jinujoseph added Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. labels Sep 28, 2018
@Neme12 Neme12 changed the title [WIP] Simplifying TypeInferrer Simplifying TypeInferrer Sep 30, 2018
@Neme12 Neme12 changed the title Simplifying TypeInferrer Fixing bugs in C# TypeInferrer Sep 30, 2018
static void Main(string[] args)
{
Func<int, int> f = x => Goo(x);
Func<string, int> f = x => Goo(x);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

these tests seem to have changed? is thatbecause new similar tests were added? if not, can we restore the tests to the original state and add new tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed it so that the return type is different than the parameter type. This would help catch bugs if they got mixed up during the generation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you do that as new tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you don't like this change, I'd prefer to revert it instead. I don't think adding a new one adds any value...

@Neme12
Copy link
Copy Markdown
Contributor Author

Neme12 commented Oct 3, 2018

@sharwell This PR may look huge, but it's really just a huge amount of new tests. I hope it doesn't take much of your time to review this. Thanks.

Copy link
Copy Markdown
Contributor

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

Could use a little clarity/comments in one location. But otherwise looks great!

@Neme12
Copy link
Copy Markdown
Contributor Author

Neme12 commented Oct 10, 2018

retest windows_debug_vs-integration_prtest please

@Neme12
Copy link
Copy Markdown
Contributor Author

Neme12 commented Oct 10, 2018

retest windows_release_vs-integration_prtest please


[Fact, Trait(Traits.Feature, Traits.Features.TypeInferenceService)]
[WorkItem(4486, "https://github.com/dotnet/roslyn/issues/4486")]
public async Task TestReturnInAsyncLambda1()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 Covered by TestReturnInAsyncTaskOfTParenthesizedLambda


[Fact, Trait(Traits.Feature, Traits.Features.TypeInferenceService)]
[WorkItem(4486, "https://github.com/dotnet/roslyn/issues/4486")]
public async Task TestReturnInAsyncLambda2()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 Covered by TestReturnInAsyncTaskOfTAnonymousMethod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

5 participants