Skip to content

Unsafe evolution: add warning for unsafe delegates#82730

Open
jjonescz wants to merge 2 commits intodotnet:mainfrom
jjonescz:Unsafe-22-UnsafeDelegateWarning
Open

Unsafe evolution: add warning for unsafe delegates#82730
jjonescz wants to merge 2 commits intodotnet:mainfrom
jjonescz:Unsafe-22-UnsafeDelegateWarning

Conversation

@jjonescz
Copy link
Member

@jjonescz jjonescz commented Mar 12, 2026

Test plan: #81207

Microsoft Reviewers: Open in CodeFlow

@jjonescz jjonescz marked this pull request as ready for review March 12, 2026 19:30
@jjonescz jjonescz requested a review from a team as a code owner March 12, 2026 19:30
@jjonescz jjonescz requested review from 333fred and jcouv March 12, 2026 19:30
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Emit;
using Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel;
Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary?

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (commit 1) modulo unnecessary using

@jcouv jcouv self-assigned this Mar 12, 2026
@jjonescz
Copy link
Member Author

@333fred for another review, thanks

Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

LGTM other than a suggestion on wording.

<comment>'RequiresUnsafe', 'extern', and 'new()' should not be localized. {2} is the generic method or type.</comment>
</data>
<data name="WRN_UnsafeMeaningless" xml:space="preserve">
<value>The 'unsafe' modifier does not have any effect here under the current rules.</value>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<value>The 'unsafe' modifier does not have any effect here under the current rules.</value>
<value>The 'unsafe' modifier does not have any effect here under the memory safety current rules.</value>

<comment>'unsafe' is a keyword, should not be localized.</comment>
</data>
<data name="WRN_UnsafeMeaningless_Title" xml:space="preserve">
<value>The 'unsafe' modifier does not have any effect here under the current rules.</value>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<value>The 'unsafe' modifier does not have any effect here under the current rules.</value>
<value>The 'unsafe' modifier does not have any effect here under the memory safety current rules.</value>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants