Skip to content

SPLA-3307: Update ConstantAttributeAnalyzer to check for compound assignment#971

Open
muaaz556 wants to merge 3 commits intomainfrom
mmahmud/spla-3307/update-constant-attribute-analyzer
Open

SPLA-3307: Update ConstantAttributeAnalyzer to check for compound assignment#971
muaaz556 wants to merge 3 commits intomainfrom
mmahmud/spla-3307/update-constant-attribute-analyzer

Conversation

@muaaz556
Copy link
Copy Markdown
Contributor

@muaaz556 muaaz556 commented Apr 2, 2026

Updated ConstantAttributeAnalyzer to check for compound assignment.

Story: https://desire2learn.atlassian.net/browse/SPLA-3307

if( @operator is null ) {
return;
}
if( @operator.Parameters.Length != 1 ) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is any other case possible?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No the implicit operator can only have a single parameter. I'll just remove this check

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh ok cool. If the answer was "don't know" I would have suggested considering making an "I don't know what happened you need to fix the analyzer" diagnostic for the unexpected scenario, that's worked OK in the past too. But if we know it's not possible then 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked the microsoft docs and also tried to add an extra parameter to an implicit operator which gave me an error. I'm pretty sure it should be a single parameter but I'll add that diagnostic in though just incase I missed something.

j3parker
j3parker previously approved these changes Apr 2, 2026
@muaaz556 muaaz556 marked this pull request as ready for review April 2, 2026 19:43
@muaaz556 muaaz556 requested a review from omsmith as a code owner April 2, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants