dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.99k stars 4.03k forks source link

Add ErrorCode to RuntimeRudeEdit #74666

Open tmat opened 2 months ago

tmat commented 2 months ago

Background and Motivation

See https://github.com/dotnet/roslyn/pull/74625

Proposed API

namespace Microsoft.CodeAnalysis.Emit;
{
     public readonly struct RuntimeRudeEdit
     {
+        public int ErrorCode { get; }

+        public RuntimeRudeEdit(string message, int errorCode)

+        [Obsolete("Specify errorCode")]
          public RuntimeRudeEdit(string message);
     }

Usage Examples

Used by Roslyn EnC analyzer in the IDE to specify error code for runtime rude edit.

Alternative Designs

Risks

dotnet-issue-labeler[bot] commented 2 months ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 2 months ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

333fred commented 1 month ago

API Review

Approved