Decorating a generic method with Tracing utility and calling that method more than once with different T would cause an exception, because the T that we cache would mismatch the new T resulting in System.InvalidCastException.
Changes
The fix is to change the cache key to use the full method name coming from the target method that was decorated, this will take into account the T, return T and T parameters making the key unique.
Added tests to validate generic method decoration.
User experience
Please share what the user experience looks like before and after this change
Checklist
Please leave checklist items unchecked if they do not apply to your change.
Issue number: #571
Summary
Decorating a generic method with Tracing utility and calling that method more than once with different T would cause an exception, because the T that we cache would mismatch the new T resulting in
System.InvalidCastException
.Changes
The fix is to change the cache key to use the full method name coming from the target method that was decorated, this will take into account the T, return T and T parameters making the key unique. Added tests to validate generic method decoration.
User experience
Checklist
Please leave checklist items unchecked if they do not apply to your change.
Is this a breaking change?
**RFC issue number**: Checklist: * [ ] Migration process documented * [ ] Implement warnings (if it can live side by side)Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.