This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
Allow ad hoc mock method implementations to specify whether the function signature from an overridden method should be used when generating the mock class #267
Labels
See #253 for context.
Given some type with a method:
A "standard" ad hoc mock like the following one would result in a mock class with
someMethod
having the signature(string|int): string
(matching the signature of the ad hoc implementation):Whereas a special token like
{useOriginalSignature}
would change the behaviour and result in a mock class withsomeMethod
having the signature(string): string|int
(matching the signature of the original method):Alternatively, perhaps the behaviour could be flipped, defaulting to using the overridden method's signature, and a keyword like
override
(inspired by languages that require explicit override declaration) could indicate that the signature of the ad hoc implementation should be used. This would be a BC break, however.The text was updated successfully, but these errors were encountered: