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
While all static type checking will check out fine, there's still an error here: at runtime, the callback's arg will never have type It.IsAnyType—it should really be typed object. Otherwise the callback will throw an ArgumentException ("Object of type '...' cannot be converted to type 'Moq.It+IsAnyType'.").
I believe that any use of type matchers with setup callbacks should be forbidden to catch that kind of mistake early.
The text was updated successfully, but these errors were encountered:
This is a follow-up to #1137.
While all static type checking will check out fine, there's still an error here: at runtime, the callback's
arg
will never have typeIt.IsAnyType
—it should really be typedobject
. Otherwise the callback will throw anArgumentException
("Object of type '...' cannot be converted to type 'Moq.It+IsAnyType'.").I believe that any use of type matchers with setup callbacks should be forbidden to catch that kind of mistake early.
The text was updated successfully, but these errors were encountered: