-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix pattern based arguments in ForEachLoopOperationInfo without binding assumptions #59887
Fix pattern based arguments in ForEachLoopOperationInfo without binding assumptions #59887
Conversation
@333fred can you have a look? |
…ionInfoArguments2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done review pass (commit 3)
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IForEachLoopStatement.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IForEachLoopStatement.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IForEachLoopStatement.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IForEachLoopStatement.cs
Show resolved
Hide resolved
…y.cs Co-authored-by: Fred Silberberg <fred@silberberg.xyz>
…s_IForEachLoopStatement.cs Co-authored-by: Fred Silberberg <fred@silberberg.xyz>
…s_IForEachLoopStatement.cs Co-authored-by: Fred Silberberg <fred@silberberg.xyz>
…ionInfoArguments2
…ub.com/bernd5/roslyn into fix_ForEachLoopOperationInfoArguments2
@333fred good point - it is good to check especially the line values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 10). @AlekseyTs @dotnet/roslyn-compiler for a second review.
…ionInfoArguments2
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IForEachLoopStatement.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IForEachLoopStatement.cs
Show resolved
Hide resolved
…ionInfoArguments2
Thanks for the contribution @bernd5! |
While looking for a new public IArgumentOperation API for pattern based calls (Dispose / GetEnumerator / MoveNext) I have seen that the non public class
ForEachLoopOperationInfo
is not filled correclty withIArgumentOperation
.This PR makes use of the new
MethodArgumentInfo
and fixes the missing IArgumentOperations in ForEachLoopOperationInfo (see the test cases).This PR removes explicitly the
IsExtensionMethod
check - this should and is handled during binding - but not in the IOperationsFactory.