You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
Expanding again on the shapes examples in the contravariance documentation, if we reimplement the RectangleComparer as a decorator and register it thus:
Unfortunately, the second fails because the contravariant search for IComparer<Square> doesn't pick up the decorator. It's clearly blind to anything other than a traditional registration.
It currently passes because it does partly demonstrate that contravariant decorators do almost work - but the crucial lines within it are commented out:
Expanding again on the shapes examples in the contravariance documentation, if we reimplement the
RectangleComparer
as a decorator and register it thus:We would expect both the following two assertions to hold:
Unfortunately, the second fails because the contravariant search for
IComparer<Square>
doesn't pick up the decorator. It's clearly blind to anything other than a traditional registration.See this test in the examples project:
Rezolver/test/Rezolver.Tests.Examples/ContravarianceExamples.cs
Lines 123 to 124 in d6d23f0
It currently passes because it does partly demonstrate that contravariant decorators do almost work - but the crucial lines within it are commented out:
Rezolver/test/Rezolver.Tests.Examples/ContravarianceExamples.cs
Lines 141 to 142 in d6d23f0
The text was updated successfully, but these errors were encountered: