-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Allow parsing ref readonly
parameters in cref
#69104
Allow parsing ref readonly
parameters in cref
#69104
Conversation
308e1b2
to
cd16b91
Compare
cd16b91
to
d2c7205
Compare
|
||
var parameterSymbol = ((IMethodSymbol)model.GetSymbolInfo(cref).Symbol).Parameters.Single(); | ||
Assert.Equal(RefKind.In, parameterSymbol.RefKind); | ||
} | ||
|
||
[Fact] | ||
public void CRef_RefReadonlyParameter() |
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.
Consider also testing readonly ref
(error) #Resolved
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 Thanks (iteration 1)
da231e3
to
4ec46b2
Compare
src/Compilers/CSharp/Portable/Parser/DocumentationCommentParser.cs
Outdated
Show resolved
Hide resolved
/// there is no name and there are no attributes or other modifiers. | ||
/// </summary> | ||
internal sealed partial class CrefParameterSyntax : CSharpSyntaxNode | ||
{ | ||
internal readonly SyntaxToken? refKindKeyword; | ||
internal readonly SyntaxToken? readOnlyKeyword; |
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.
another, possibly cleaner, way to do this is to just changet this to a TokenList of Modifiers.
Done with review pass (commit 2) |
src/Compilers/CSharp/Portable/Parser/DocumentationCommentParser.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Parser/DocumentationCommentParser.cs
Outdated
Show resolved
Hide resolved
Done with review pass (commit 7) |
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 8)
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 9)
// (3,16): error CS8652: The feature 'ref readonly parameters' is currently in Preview and *unsupported*. To use Preview features, use the 'preview' language version. | ||
// void M(ref readonly int x) | ||
Diagnostic(ErrorCode.ERR_FeatureInPreview, "readonly").WithArguments("ref readonly parameters").WithLocation(3, 16), | ||
// (8,26): warning CS1658: The feature 'ref readonly parameters' is currently in Preview and *unsupported*. To use Preview features, use the 'preview' language version.. See also error CS8652. |
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.
not related to this PR: I'm curious whether this warning override will trigger the IDE fixer to turn on the preview LangVer. This would be a pre-existing issue. May need to file an issue
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.
It won't. Filed #69228.
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 Thanks (iteration 9)
Test plan: #68056