问题
I am attempting to transform eager class instantiation to lazy instantiation. I've followed the eager pattern throughout the codebase, but now want to change it to the lazy alternative (and remove the setter while I'm at it). ReSharper's custom pattern find/replace seems like the perfect tool for this.
Happy
If I have private....
by itself, the pattern searches fine.
If I have public....
by itself, the pattern searches fine.
Sad
As soon as I try to combine the two lines, it fails with "pattern is ambiguous"
Unknown??
If it helps, when I have the private...
line and paste in the second blip, the auto-placeholder mechanism fails to do anything with $name$
. Again, both segments work perfectly by themselves. I'm at a loss.
Note: There is analogous behavior in the "replace" box, which is why I'm largely ignoring it in my description of the problem.
Update 12/11/2015
I tried this in ReSharper 10 (Ultimate) and I get the same failing behavior.
Update 9/8/2016
Latest test in "ReSharper Ultimate 2016.1.2" still fails.
来源:https://stackoverflow.com/questions/34210827/resharper-custom-pattern-ambiguous-with-multiple-member-definitions