Fully update the type inferrer and add tests for generate field#36173
Conversation
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/GenerateVariable/GenerateVariableTests.cs
Outdated
Show resolved
Hide resolved
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
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Outdated
Show resolved
Hide resolved
0f49a54 to
992c4db
Compare
There was a problem hiding this comment.
Since I think binding of indexers are now working (:wink:), I updated the test to be more appropriate.
There was a problem hiding this comment.
GetAllTypeArgments finds all the type arguments including for parent types -- but since all callers passed 0 for parameterIndex it was moot.
992c4db to
3001540
Compare
There was a problem hiding this comment.
@CyrusNajmabadi This scenario seems off -- shouldn't it be looking for Add methods or something else here...? I guess I'm not quite following this one.
There was a problem hiding this comment.
Yes. I think you're correct. Not sure why we did things this way.
The feature requires no extra work, just some tests. Closes dotnet#30323
3001540 to
f472469
Compare
ryzngard
left a comment
There was a problem hiding this comment.
Yup, looks like a lot of tests and WithNullability additions. I couldn't immediately think of a scenario not covered, so LGTM
"Fixes" generate field in that this really just fixes up the rest of the TypeInferrer -- at this point once that was fixed the feature just lit up. Added some basic tests to cover.