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 }}
Repository navigation
[Bug]: WhenPropertyChanged() does not recognize INotifyPropertyChanged when casting is involved. #1156
The current implementation of WhenPropertyChangedBehaviorFixture.ExpressionContainsImplicitInterfaceCast() has 99% of this scenario. In fact, writing it is how I noticed this scenario.
If INotifyPropertyChanged is removed from IHasAge and moved down to ChildModel, then the test stops working. The .WhenPropertyChanged() operator seems to only be looking at an object's interpreted type within the expression to see if it has INotifyPropertyChanged compatibility. I.E. if the expression itself doesn't report INotifyPropertyChanged compatibility at compile-time, then the operator doesn't recognize it.
Since INotifyPropertyChanged subscriptions take place at runtime, rather than expression-compile-time, it should be entirely possible to check for compatibility on each object instance, immediately before a subscription would occur. I've got no idea how easy this will be to implement within the existing system, though.
Activity