-
Notifications
You must be signed in to change notification settings - Fork 467
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
Improve support for covariant returns (where generic types are involved) #643
Conversation
@jonorossi, I'd appreciate your input on one particular detail here. In principle, this PR is an extension of #619, whose code patterns it duplicates for the most part. After this PR, the |
src/Castle.Core/DynamicProxy/Generators/MethodSignatureComparer.cs
Outdated
Show resolved
Hide resolved
src/Castle.Core/DynamicProxy/Generators/MethodSignatureComparer.cs
Outdated
Show resolved
Hide resolved
src/Castle.Core/DynamicProxy/Generators/MethodSignatureComparer.cs
Outdated
Show resolved
Hide resolved
6aec65a
to
33fa217
Compare
(The type name `DerivedEmptyGenericRecord` suggests that it is generic, which is not the case; `DerivedFromEmptyGenericRecord` is more accurate. For consistency, let's apply the same name change to `EmptyRecord` and its subtype.)
ef923a1
to
189dd28
Compare
Performing this check for anything other than return types is basically wasted time, so moving it to `EqualReturnTypes` means it will only run when actually needed.
189dd28
to
6b16135
Compare
Fixes #632.
It turns out that we only added support for non-generic covariant return types in #619; however there are two additional cases that we need to support, too:
(I'm counting those as two distinct cases due to the code structure found inside
MethodSignatureComparer.EqualSignatureTypes
, which is the method that needs to be augmented.)