Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OverloadResolutionPriority with Debug/Trace.Assert(string) #104942

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

stephentoub
Copy link
Member

using System.Diagnostics;

SomeMethod(6, 10);

static void SomeMethod(int a, int b)
{
    Debug.Assert(a > 0);
    Debug.Assert(b > 0);
    Debug.Assert((a - 3) > (b / 2));
}

Before:

Process terminated. Assertion failed.
   at Program.<<Main>$>g__SomeMethod|0_0(Int32 a, Int32 b)

After:

Process terminated. Assertion failed.
(a - 3) > (b / 2)
   at Program.<<Main>$>g__SomeMethod|0_0(Int32 a, Int32 b)

Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

@KennethHoff
Copy link

inb4 this is also unexpectedly breaking akin to ICollection : IReadOnlyCollection 😅

@stephentoub
Copy link
Member Author

inb4 this is also unexpectedly breaking akin to ICollection : IReadOnlyCollection 😅

How is this breaking?

@KennethHoff
Copy link

KennethHoff commented Jul 17, 2024

No idea. It was a bad joke. It's similar-ish DX improvements to old APIs so it would be (not..) funny if they both had similar reasons to not be improved; back compatibility breaks.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants