-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2933 static using math #3205
base: master
Are you sure you want to change the base?
2933 static using math #3205
Conversation
thanks for the PR. You need to add some tests to explicitly test for static using. May I also suggest you should check first if the method name is of interest before resolving its symbol ? Alternatively, having a benchmark (on a significant/large project) that demonstrates the cost being negligible is ok too . |
Hi @dupdob , Thanks for your feedback. I've added explicit tests for static using calls and updated MathMutator to check the method name before resolving the symbol. Unfortunately, I haven't been able to run benchmarks on a large project yet, but based on theoretical analysis, the filtering should mitigate performance concerns. Let me know if you have any further suggestions. |
thanks @jacinyan. This is exactly what I had in mind; filtering on the name and then checking for actual type looks like the optimized approach.
|
Thanks @dupdob . I've made some changes accordingly. All tests passed. Please review. |
Summary
Fixes #2933 by using the semantic model to detect calls to System.Math when using
static using
. This ensuresFloor(5.5)
is correctly mutated, just likeMath.Floor(5.5)
.Changes
Testing
FloorValue
,MixedFloorValue
, etc.).