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.

0
2 comments

Try making $j$ an expression placeholder, and specifying Int32 as the expression type.

0
Avatar
Permanently deleted user

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.

0

Please sign in to leave a comment.