-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Implement IAttributeOperation #59369
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
Conversation
|
@RikkiGibson Can you take another look? I haven't yet added tests for |
333fred
left a comment
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.
Overall this is looking very good. I think it just needs a few more tests.
|
@333fred I added more tests. |
333fred
left a comment
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 72). @dotnet/roslyn-compiler for a second review.
RikkiGibson
left a comment
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 with very minor nits. Let us know if you plan on changing anything in response to the new comments.
| /// <summary> | ||
| /// Creates an AttributeSemanticModel that allows asking semantic questions about an attribute node. | ||
| /// </summary> | ||
| public static AttributeSemanticModel Create(SyntaxTreeSemanticModel containingSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Symbol? attributeTarget, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt) |
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.
Was this addressed by #62137?
| } | ||
|
|
||
| [Fact] | ||
| public void TestAttributeCallerInfoSemanticModel_Method_Speculative2() |
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.
I didn't understand what this was testing versus the original. Does it matter that Method_Speculative uses a string literal and Method_Speculative2 uses a constant-valued interpolated string?
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.
I don't recall why did I add this test :(
I think it doesn't harm anyway.
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.
Works for me. Thanks
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IAttributeOperation.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IAttributeOperation.cs
Outdated
Show resolved
Hide resolved
…s_IAttributeOperation.cs
|
Tagging @dotnet/roslyn-ide for review of changes under |
JoeRobich
left a comment
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.
The changes under src/Analyzers look good to me.
|
@Youssef1313 can you resolve the conflict? Then we can get this merged :) |
|
Thanks @Youssef1313! |
This reverts commit d89769b.
Revert "Implement IAttributeOperation (#59369)"
…rs in attributes Fixes an issue introduced with dotnet/roslyn#59369, as the AvoidZeroLengthAllocations analyzer did not see these params parameters before.
…rs in attributes Fixes an issue introduced with dotnet/roslyn#59369, as the AvoidZeroLengthAllocations analyzer did not see these params parameters before.
Fixes #18198
Fixes #53618
Not yet ready to merge, but wanted to get initial feedback.
FYI @CyrusNajmabadi