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

Add test coverage for generic type substitution with byreflike generics #71276

Merged

Conversation

jkoritzinsky
Copy link
Member

This test coverage also found some interesting behavior (issue TBD) in the following scenario:

Given a <byreflike T> (aka a T that can be a byreflike type), we allow passing this to a <U> generic parameter (where U does not allow byref-like types).

We do correctly throw when instantiating the generic with a byreflike type though, so we don't end up in a bad state.

I've marked this test with an ActiveIssue attribute pending feedback on whether or not this is a bug.

This test coverage also found some interesting behavior (issue TBD) in the following scenario:

Given a `<byreflike T>` (aka a `T` that can be a byreflike type), we allow passing this to a `<U>` generic parameter (where `U` does not allow byref-like types).

We do correctly throw when instantiating the generic with a byreflike type though, so we don't end up in a bad state.

I've marked this test with an ActiveIssue attribute pending feedback on whether or not this is a bug.
@AaronRobinsonMSFT
Copy link
Member

Test assets for #65112.

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 946e63a into dotnet:main Jun 28, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 28, 2022
@jkoritzinsky jkoritzinsky deleted the refstruct-generic-substitution branch March 22, 2024 01:25
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.

2 participants