Skip to content

Unsafe evolution: fix name of ISymbol public API - #84784

Open
jjonescz wants to merge 1 commit into
dotnet:mainfrom
jjonescz:Unsafe-47-SymbolApiRename
Open

Unsafe evolution: fix name of ISymbol public API#84784
jjonescz wants to merge 1 commit into
dotnet:mainfrom
jjonescz:Unsafe-47-SymbolApiRename

Conversation

@jjonescz

@jjonescz jjonescz commented Aug 6, 2026

Copy link
Copy Markdown
Member

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

@jjonescz
jjonescz requested a review from a team as a code owner August 6, 2026 12:51
Copilot AI review requested due to automatic review settings August 6, 2026 12:51
@jjonescz
jjonescz requested review from a team as code owners August 6, 2026 12:51
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added VSCode Needs API Review Needs to be reviewed by the API review council labels Aug 6, 2026
@dotnet-policy-service

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.RequiresUnsafeISymbol.RequiresUnsafeContext in 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.

Comment thread src/Compilers/Core/Portable/Symbols/ISymbol.cs
@jjonescz

jjonescz commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

@333fred @RikkiGibson for a compiler review, thanks

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants