Skip to content

C#: Handle unbound types in conversion library #2024

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

Merged
merged 3 commits into from
Oct 2, 2019

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Sep 25, 2019

A constructed type, C<T>, where T is the type parameter of C, is represented in the database as the corresponding unbound generict type C<>. Consequently, the type conversion library, which only considers ConstructedTypes, does not handle all implicit conversions. For example, in

interface I<in T1, T2> where T1 : C

there should be an implicit conversion from I<C, T2> to I<T1, T2> (=I<>).

dist-compare report here (internal link).

A constructed type, `C<T>`, where `T` is the type parameter of `C`, is represented
in the database as the corresponding unbound generict type `C<>`. Consequently, the
type conversion library, which only considers `ConstructedType`s, does not handle
all implicit conversions. For example, in

```
interface I<in T1, T2> where T1 : C
```

there should be an implicit conversion from `I<C, T2>` to `I<T1, T2>` (=`I<>`).
@hvitved hvitved added the C# label Sep 25, 2019
@hvitved hvitved requested a review from calumgrant September 25, 2019 14:27
@hvitved hvitved requested a review from a team as a code owner September 25, 2019 14:27
Copy link
Contributor

@calumgrant calumgrant left a comment

Choose a reason for hiding this comment

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

This is really really excellent. A nice simplification.

@calumgrant calumgrant merged commit eb893fb into github:master Oct 2, 2019
@hvitved hvitved deleted the csharp/conversion-unbound branch October 2, 2019 14:40
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.

2 participants