CallerArgumentExpression: Warning for self-referential#54129
Merged
333fred merged 3 commits intodotnet:features/caller-argument-expressionfrom Jun 17, 2021
Merged
CallerArgumentExpression: Warning for self-referential#54129333fred merged 3 commits intodotnet:features/caller-argument-expressionfrom
333fred merged 3 commits intodotnet:features/caller-argument-expressionfrom
Conversation
46 tasks
Member
Author
|
CI is stuck. Closing & reopening. |
AlekseyTs
reviewed
Jun 16, 2021
| <value>The CallerArgumentExpressionAttribute applied to parameter '{0}' will have no effect because it's self-referential.</value> | ||
| </data> | ||
| <data name="WRN_CallerArgumentExpressionAttributeSelfReferential_Title" xml:space="preserve"> | ||
| <value>The CallerArgumentExpressionAttribute is applied with a self-referential parameter.</value> |
Contributor
There was a problem hiding this comment.
The CallerArgumentExpressionAttribute is applied with a self-referential parameter.
We usually use the original message with removed placeholders. I think this will work well in this case as well: "The CallerArgumentExpressionAttribute applied to parameter will have no effect because it's self-referential." #Closed
AlekseyTs
reviewed
Jun 16, 2021
|
|
||
| var compilation = CreateCompilation(source, targetFramework: TargetFramework.NetCoreApp, options: TestOptions.ReleaseExe); | ||
| compilation.VerifyDiagnostics(); | ||
| compilation.VerifyDiagnostics( |
Contributor
AlekseyTs
reviewed
Jun 16, 2021
|
|
||
| var compilation = CreateCompilation(source, targetFramework: TargetFramework.NetCoreApp, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular9); | ||
| compilation.VerifyDiagnostics(); | ||
| compilation.VerifyDiagnostics( |
Contributor
AlekseyTs
reviewed
Jun 16, 2021
| // PROTOTYPE(caller-expr): Should this have a warning? | ||
| [ConditionalFact(typeof(CoreClrOnly))] | ||
| public void TestArgumentExpressionIsReferingToItself() | ||
| public void TestArgumentExpressionIsSelfReferential() |
Contributor
Contributor
|
Done with the review pass (commit 1) |
Member
Author
|
@AlekseyTs Thanks for review. I addressed your feedback. |
Contributor
|
@dotnet/roslyn-compiler, @333fred Please review, need a second review for a Community PR. |
Member
|
Thanks @Youssef1313! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal: dotnet/csharplang#287
Test plan: #52745
Addresses part of LDM notes: https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-06-14.md