Unsafe evolution: fix name of ISymbol public API - #84784
Open
jjonescz wants to merge 1 commit into
Open
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
This PR modifies public API files. Please follow the instructions at https://github.com/dotnet/roslyn/blob/main/docs/contributing/API%20Review%20Process.md for ensuring all public APIs are reviewed before merging. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Roslyn public ISymbol API surface to fix the name of the unsafe-related property by renaming RequiresUnsafe to RequiresUnsafeContext, and updates all in-repo implementations, baselines, and tests to match.
Changes:
- Rename
ISymbol.RequiresUnsafe→ISymbol.RequiresUnsafeContextin the core public interface. - Update C# and VB public symbol implementations/wrappers and codegen symbols to implement the renamed member.
- Update public API baselines/reference-API lists and adjust unsafe-evolution tests accordingly.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Compilers/Core/Portable/Symbols/ISymbol.cs | Renames the public interface property and adjusts its XML doc comment. |
| src/Compilers/Core/Portable/PublicAPI.Unshipped.txt | Updates the unshipped API entry to RequiresUnsafeContext. |
| src/Compilers/CSharp/Portable/Symbols/PublicModel/Symbol.cs | Updates C# public model explicit ISymbol implementation to the new property name. |
| src/Compilers/CSharp/Portable/Symbols/PublicModel/PreprocessingSymbol.cs | Updates preprocessing symbol ISymbol implementation to the new property name. |
| src/Compilers/VisualBasic/Portable/Symbols/Symbol.vb | Updates VB ISymbol implementation member name to RequiresUnsafeContext. |
| src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs | Updates metadata-as-source wrapped symbol forwarding property to RequiresUnsafeContext. |
| src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationSymbol.cs | Updates code generation symbol surface to include RequiresUnsafeContext. |
| src/Tools/SemanticSearch/ReferenceAssemblies/Apis/Microsoft.CodeAnalysis.txt | Updates the reference assembly API list entry to get_RequiresUnsafeContext. |
| src/Compilers/CSharp/Test/CSharp15/UnsafeEvolutionTests.cs | Renames test methods and assertions to use RequiresUnsafeContext. |
jasonmalinowski
approved these changes
Aug 6, 2026
Member
Author
|
@333fred @RikkiGibson for a compiler review, thanks |
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.
Follow up on #84674 where I accidentally implemented the API under the originally proposed name instead of the actually approved name.
Public API issue: #82791
Test plan: #81207
Microsoft Reviewers: Open in CodeFlow