Skip to content

Unsafe evolution: check caller unsafe context for usages of some methods and properties#81581

Merged
jjonescz merged 10 commits into
dotnet:features/UnsafeEvolutionfrom
jjonescz:Unsafe-04-Members
Dec 15, 2025
Merged

Unsafe evolution: check caller unsafe context for usages of some methods and properties#81581
jjonescz merged 10 commits into
dotnet:features/UnsafeEvolutionfrom
jjonescz:Unsafe-04-Members

Conversation

@jjonescz

@jjonescz jjonescz commented Dec 8, 2025

Copy link
Copy Markdown
Member

Test plan: #81207

More member kinds (besides methods and properties; and also some other types of methods, like synthesized methods) will be handled in a follow up (once this proof of concept is approved). OHI is also not handled in this PR.

@jjonescz jjonescz marked this pull request as ready for review December 8, 2025 11:34
@jjonescz jjonescz requested a review from a team as a code owner December 8, 2025 11:35
@jjonescz jjonescz requested review from 333fred and jcouv December 8, 2025 11:35
@jcouv jcouv self-assigned this Dec 8, 2025
Comment thread src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEMethodSymbol.cs
Comment thread src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEMethodSymbol.cs Outdated
Comment thread src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEPropertySymbol.cs Outdated
Comment thread src/Compilers/CSharp/Portable/Symbols/Symbol.cs Outdated
Comment thread src/Compilers/CSharp/Test/Emit3/Semantics/UnsafeEvolutionTests.cs Outdated
Comment thread src/Compilers/CSharp/Test/Emit3/Semantics/UnsafeEvolutionTests.cs
Comment thread src/Compilers/CSharp/Test/Emit3/Semantics/UnsafeEvolutionTests.cs Outdated
Comment thread src/Compilers/CSharp/Test/Emit3/Semantics/UnsafeEvolutionTests.cs Outdated
Comment thread src/Compilers/CSharp/Test/Emit3/Semantics/UnsafeEvolutionTests.cs
Comment thread src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
Comment thread src/Compilers/CSharp/Test/Emit3/Semantics/UnsafeEvolutionTests.cs
Comment thread src/Compilers/CSharp/Portable/Symbols/Metadata/PE/PEPropertySymbol.cs Outdated
Comment thread src/Compilers/CSharp/Portable/Symbols/Symbol.cs Outdated
Comment thread src/Compilers/CSharp/Portable/Symbols/Symbol.cs
@jcouv

jcouv commented Dec 9, 2025

Copy link
Copy Markdown
Member

It was not clear from the PR title "handle unsafe methods and properties" whether OHI scenarios would be included in this PR. Consider refining the title, as the PR is focused on checking the unsafe context for usages of methods and properties. #Closed

Comment thread src/Compilers/CSharp/Portable/Symbols/Source/SourceModuleSymbol.cs
Comment thread src/Compilers/CSharp/Test/Emit3/Semantics/UnsafeEvolutionTests.cs Outdated

@jcouv jcouv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done with review pass (commit 2) Will finish looking at the tests tomorrow

@jjonescz jjonescz changed the title Unsafe evolution: handle unsafe methods and properties Unsafe evolution: check caller unsafe context for usages of some methods and properties Dec 9, 2025
Comment thread src/Compilers/CSharp/Test/Emit3/Semantics/UnsafeEvolutionTests.cs Outdated
Comment thread src/Compilers/CSharp/Portable/Symbols/Source/LambdaSymbol.cs

@jcouv jcouv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done with review pass (commit 5)

@jjonescz jjonescz requested review from 333fred and jcouv December 10, 2025 14:17

@jcouv jcouv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM Thanks (commit 9)

@333fred 333fred left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Think my only comment left is on the error message.

@jjonescz jjonescz requested a review from 333fred December 11, 2025 10:00
@jjonescz

Copy link
Copy Markdown
Member Author

@333fred for another look, thanks

@jjonescz jjonescz merged commit ba1d672 into dotnet:features/UnsafeEvolution Dec 15, 2025
29 checks passed
@jjonescz jjonescz deleted the Unsafe-04-Members branch December 15, 2025 10:22
jjonescz added a commit that referenced this pull request Dec 19, 2025
…81698)

Test plan: #81207

Follow up on #81581 (i.e., still
only for methods and properties).
1. Checking lang version.
2. Improving some tests.
jjonescz added a commit that referenced this pull request Dec 19, 2025
jjonescz added a commit that referenced this pull request Jan 7, 2026
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