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

[Bug] GenerateReferenceAssemblySource drops constraint #100843

Closed
terrajobst opened this issue Apr 9, 2024 · 3 comments
Closed

[Bug] GenerateReferenceAssemblySource drops constraint #100843

terrajobst opened this issue Apr 9, 2024 · 3 comments

Comments

@terrajobst
Copy link
Contributor

A community member pointed out to me that System.Enum.GetNames<TEnum>() dropped the Enum constraint while the implementation still has it.

Running Git Blame revealed that this changed in e5d59bd by @jkotas.

It looks like the tool has dropped this constraint but not in all cases.

It would be good to understand why that is so we don't inadvertently change the reference assemblies.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 9, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 9, 2024
@terrajobst terrajobst added area-Infrastructure-libraries and removed untriaged New issue has not been triaged by the area owner labels Apr 9, 2024
@ericstj ericstj added untriaged New issue has not been triaged by the area owner and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 9, 2024
@ericstj
Copy link
Member

ericstj commented Apr 10, 2024

We need to add APICompat support to check these: dotnet/sdk#39659

The latest GenAPI handles this scenario. I tested with a standalone lib that exposes a similar API and it emits:

        public static string[] GetNames<TEnum>()
            where TEnum : struct, System.Enum { throw null; }

So this gets fixed when we fix dotnet/sdk#31088

@jkotas
Copy link
Member

jkotas commented Apr 10, 2024

It looks like the tool has dropped this constraint but not in all cases.

The genapi tooling has number of issues.

The reformatting was motivated by work on new unrelated APIs. I wanted the ref sources to be auto-generated, but then noticed a lot of formatting inconsistencies in System.Runtime ref sources. I tried to keep just the style changes only and revert everything else, but missed this one.

Thank you FlashOver for catching it!

@jkotas
Copy link
Member

jkotas commented Apr 10, 2024

Fixed by #100844

The underlying problem is duplicate of issues listed in #100843 (comment) .

@jkotas jkotas closed this as completed Apr 10, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Apr 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants