Fixing bugs in C# TypeInferrer#30211
Conversation
…eLambdaExpression
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.
960d675 to
6ab5672
Compare
7ddebc9 to
af1b5da
Compare
40c5e7b to
037b68f
Compare
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Show resolved
Hide resolved
| static void Main(string[] args) | ||
| { | ||
| Func<int, int> f = x => Goo(x); | ||
| Func<string, int> f = x => Goo(x); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
can you do that as new tests?
There was a problem hiding this comment.
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...
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Outdated
Show resolved
Hide resolved
|
@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. |
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Show resolved
Hide resolved
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Outdated
Show resolved
Hide resolved
CyrusNajmabadi
left a comment
There was a problem hiding this comment.
Could use a little clarity/comments in one location. But otherwise looks great!
|
retest windows_debug_vs-integration_prtest please |
|
retest windows_release_vs-integration_prtest please |
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Show resolved
Hide resolved
|
|
||
| [Fact, Trait(Traits.Feature, Traits.Features.TypeInferenceService)] | ||
| [WorkItem(4486, "https://github.com/dotnet/roslyn/issues/4486")] | ||
| public async Task TestReturnInAsyncLambda1() |
There was a problem hiding this comment.
📝 Covered by TestReturnInAsyncTaskOfTParenthesizedLambda
|
|
||
| [Fact, Trait(Traits.Feature, Traits.Features.TypeInferenceService)] | ||
| [WorkItem(4486, "https://github.com/dotnet/roslyn/issues/4486")] | ||
| public async Task TestReturnInAsyncLambda2() |
There was a problem hiding this comment.
📝 Covered by TestReturnInAsyncTaskOfTAnonymousMethod
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