Automatically remove redundant type argument specifications during code cleanup
Is it possible to configure R# so that redundant type argument specifications are automatically removed during a code cleanup?
Eample:
var result = model.Bank
.Select(p => p.Country)
.Distinct()
.ToList<Country>();
I want this to become automatically as part of a code cleanup this:
var result = model.Bank
.Select(p => p.Country)
.Distinct()
.ToList();
Please sign in to leave a comment.
It should be removed.
Please could you provide complete example, where ReSharper fails to remove it?
I can't send you the complete solution but i tried it again in another line of code:
var list = model.Bank.Include(typeof(FinInstType).Name).Include(typeof(Country).Name).ToList<Bank>();
ReSharper correctly says that the <Bank> type argument is redundant but fails to remove it automatically. It is light gray coloured. I did a Full Cleanup and I selected the entire line and did a Full Cleanup again. It is not removed...
I created a new Class Library with this code and a full cleanup still won't remove the redundant type argument specification in GetAllHumanoids():
Great! The problem is reproduced.
It will be fixed in ReSharper 5.0
Thank you.