Add missing test for CallerArgumentExpression#57805
Merged
333fred merged 4 commits intodotnet:mainfrom Nov 30, 2021
Merged
Conversation
Member
Author
|
This test, combined with dotnet/csharplang#5438 to update the spec with the conversion rules, closes out the test plan for CallerArgumentExpression. @dotnet/roslyn-compiler for a very small test-only change. |
RikkiGibson
approved these changes
Nov 16, 2021
AlekseyTs
reviewed
Nov 17, 2021
| ", targetFramework: TargetFramework.NetCoreApp); | ||
|
|
||
| comp.VerifyDiagnostics( | ||
| // (5,16): error CS8964: The CallerArgumentExpressionAttribute may only be applied to parameters with default values |
Contributor
AlekseyTs
reviewed
Nov 17, 2021
| [InlineData("out")] | ||
| [InlineData("ref")] | ||
| [InlineData("in")] | ||
| public void CallerArgumentExpression_OnRefParameter(string refType) |
Contributor
Contributor
|
Done with review pass (commit 1) |
Member
Author
|
@AlekseyTs addressed feedback. In reply to: 971899219 |
AlekseyTs
reviewed
Nov 17, 2021
| Diagnostic(ErrorCode.ERR_BadCallerArgumentExpressionParamWithoutDefaultValue, "CallerArgumentExpression").WithLocation(5, 16), | ||
| // (5,47): error CS1741: A ref or out parameter cannot have a default value | ||
| // void M(int i, [CallerArgumentExpression("i")] out string s = null) | ||
| Diagnostic(ErrorCode.ERR_RefOutDefaultValue, "out").WithLocation(5, 47) |
Contributor
AlekseyTs
reviewed
Nov 17, 2021
| { | ||
| Console.WriteLine(s); | ||
| } | ||
| ", targetFramework: TargetFramework.NetCoreApp); |
Contributor
Member
Author
There was a problem hiding this comment.
No, it will still compile against Netstandard2.0 APIs, which doesn't have CallerArgumentExpression.
AlekseyTs
approved these changes
Nov 17, 2021
Contributor
AlekseyTs
left a comment
There was a problem hiding this comment.
LGTM (commit 3), assuming CI is passing
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Dec 3, 2021
…rovements * upstream/main: (310 commits) Read SourceLink info and call service to retrieve source from there (dotnet#57978) Add new parser/lexer to the StackTraceAnalyzer (dotnet#57598) (dotnet#58050) Snap 17.1 P2 (dotnet#58041) Make it possible to analyze the dataflow of `ConstructorInitializerSyntax` and `PrimaryConstructorBaseTypeSyntax` (dotnet#57576) Shorten paths in VS installation (dotnet#57726) Add comments Add new parser/lexer to the StackTraceAnalyzer (dotnet#57598) Fix await completion for expression body lambda Add tests Fix comment Honor option, and also improve formatting with comment Skip TestLargeStringConcatenation (dotnet#58035) Log runtime framework of remote host Mark EqualityContract property accessor as not auto-implemented (dotnet#57917) Fix typo in XML doc for GeneratorExtensions (dotnet#58020) Hold Receiver directly in bound node for implicit indexer access (dotnet#58009) Pass AnalysisKind instead of int Enable nullable reference types for TableDataSource Simplify 'interpolation' data, and move to an easier to consume System.Range approach for it (dotnet#57966) Add missing test for CallerArgumentExpression (dotnet#57805) ...
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.
Closes #52745.