Skip to content

Conversation

@Youssef1313
Copy link
Member

Fixes #18198
Fixes #53618

Not yet ready to merge, but wanted to get initial feedback.

FYI @CyrusNajmabadi

@Youssef1313 Youssef1313 requested a review from a team as a code owner February 8, 2022 15:07
@ghost ghost added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Feb 8, 2022
@Youssef1313 Youssef1313 changed the title Initial implementation of IAttributeOperation Implement of IAttributeOperation Feb 9, 2022
@Youssef1313 Youssef1313 changed the title Implement of IAttributeOperation Implement IAttributeOperation Feb 9, 2022
@Youssef1313
Copy link
Member Author

@RikkiGibson Can you take another look? I haven't yet added tests for params. But want to know if the general approach is good/correct.

Copy link
Member

@333fred 333fred left a 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.

@Youssef1313
Copy link
Member Author

@333fred I added more tests.

Copy link
Member

@333fred 333fred left a 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.

Copy link
Member

@RikkiGibson RikkiGibson left a 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)
Copy link
Member

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()
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Works for me. Thanks

@RikkiGibson
Copy link
Member

Tagging @dotnet/roslyn-ide for review of changes under src/Analyzers/

Copy link
Member

@JoeRobich JoeRobich left a 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.

@333fred
Copy link
Member

333fred commented Aug 16, 2022

@Youssef1313 can you resolve the conflict? Then we can get this merged :)

@333fred 333fred merged commit d89769b into dotnet:main Aug 16, 2022
@333fred
Copy link
Member

333fred commented Aug 16, 2022

Thanks @Youssef1313!

@ghost ghost added this to the Next milestone Aug 16, 2022
333fred added a commit that referenced this pull request Aug 17, 2022
* upstream/main:
  Fix compilation of exe RefFieldTests (#63431)
  Implement IAttributeOperation (#59369)
  Restore nullable warnings for unset required members from base types (#63286)
  Remove portion of incremental-analyzer-infrastructure that has no usage.
@Youssef1313 Youssef1313 deleted the iattribute-operation branch August 17, 2022 03:39
dibarbet added a commit to dibarbet/roslyn that referenced this pull request Aug 19, 2022
JoeRobich added a commit that referenced this pull request Aug 19, 2022
Revert "Implement IAttributeOperation (#59369)"
333fred added a commit to dotnet/roslyn-analyzers that referenced this pull request Aug 29, 2022
…rs in attributes

Fixes an issue introduced with dotnet/roslyn#59369, as the AvoidZeroLengthAllocations analyzer did not see these params parameters before.
@dibarbet dibarbet modified the milestones: Next, 17.4 P2 Sep 1, 2022
ViktorHofer pushed a commit to dotnet/sdk that referenced this pull request Aug 15, 2025
…rs in attributes

Fixes an issue introduced with dotnet/roslyn#59369, as the AvoidZeroLengthAllocations analyzer did not see these params parameters before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New IOperation: IAttributeOperation IOperation API for attributes

8 participants