Custom Pattern for redundant Convert.ToInt32(Int32)
Hi,
I'm trying to create a Custom Pattern to find occurrences off Convert.ToInt32 where a Int32 argument is already provided.
I tried "$Convert$.ToInt32($j$)" where $Convert$ is a type placeholder for System.Convert <- which works perfectly fine, and $j$ is a type placeholder for System.Int32. The problem is, it doesn't work. I tried the $Convert$ part on its own, it works. What doesn't work is the System.Int32 detection.
Any clues?
Thanks.
Please sign in to leave a comment.
Try making $j$ an expression placeholder, and specifying Int32 as the expression type.
Yes, that worked.
I feel a little stupid now, cause I thought I checked all the other placeholders for the possibility to check for a type.
Thanks a lot.