-
Notifications
You must be signed in to change notification settings - Fork 226
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
Improve S6640: Support type declarations #7486
Conversation
{ | ||
"id": "S6640", | ||
"message": "Make sure that using "unsafe" is safe here.", | ||
"location": { | ||
"uri": "sources\Net5\Net5\FunctionPointers.cs", | ||
"region": { | ||
"startLine": 3, | ||
"startColumn": 12, | ||
"endLine": 3, | ||
"endColumn": 18 | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "S6640", | ||
"message": "Make sure that using "unsafe" is safe here.", | ||
"location": { | ||
"uri": "sources\Net5\Net5\S4000.cs", | ||
"region": { | ||
"startLine": 5, | ||
"startColumn": 12, | ||
"endLine": 5, | ||
"endColumn": 18 | ||
} | ||
} | ||
} |
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.
TPs
ef2c836
to
d497ea9
Compare
43128da
to
ee5d71d
Compare
ee5d71d
to
47a185d
Compare
context.RegisterNodeAction(c => | ||
{ | ||
if (c.Node is BaseTypeDeclarationSyntax { Modifiers: var modifiers } | ||
&& modifiers.Find(SyntaxKind.UnsafeKeyword) is { } unsafeModifier) |
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.
Same here. Needs a re-base.
{ | ||
Report(c, unsafeModifier); | ||
} | ||
}, SyntaxKind.ClassDeclaration, SyntaxKind.InterfaceDeclaration, SyntaxKind.StructDeclaration, SyntaxKindEx.RecordClassDeclaration); |
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.
RecordStruct seems to be missing.
47a185d
to
2a19fa3
Compare
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
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.
Follow-up to #7290