Extract Interface on a Generic Class

On a Generic Class, there is an issue with using the Extract Interface Refactoring, First R# does not allow to extract an Generic Interface, Second the return type for a method is not set properly, For instance in the example below

public class KeyValueCollection : ICollection,IList { .......... ......... public KeyValueCollection FindAll(Predicate predicate) { ......... } } If i do an Extract Interface, the interface is genertated as below public interface IKeyValueCollection { ................. IList FindAll(Predicate predicate); } which is invalid, either R# 1) should give a warning message about not extracting an interface that includes a Generic Method or 2) should not allow to extract that method at all or 3) should allow the interface to be marked as Generic or 4) should allow the interface to be marked as Generic and also allow us to select the interfaces that the new Generic Interface would inherit from essentially i would want the following end result :- public interface IKeyValueCollection : ICollection, IList { ...... IKeyValueCollection FindAll(Predicate]]> predicate);
}

Thanks,
Krishna

1 comment
Comment actions Permalink

Forgot to mention, this is in build 223 - Krishna
"Krishna" wrote in message news:dv4sop$pkt$1@is.intellij.net... On a Generic Class, there is an issue with using the Extract Interface Refactoring, First R# does not allow to extract an Generic Interface, Second the return type for a method is not set properly, For instance in the example below public class KeyValueCollection : ICollection,IList { .......... ......... public KeyValueCollection FindAll(Predicate predicate) { ......... } } If i do an Extract Interface, the interface is genertated as below public interface IKeyValueCollection { ................. IList FindAll(Predicate predicate); } which is invalid, either R# 1) should give a warning message about not extracting an interface that includes a Generic Method or 2) should not allow to extract that method at all or 3) should allow the interface to be marked as Generic or 4) should allow the interface to be marked as Generic and also allow us to select the interfaces that the new Generic Interface would inherit from essentially i would want the following end result :- public interface IKeyValueCollection : ICollection, IList { ...... IKeyValueCollection FindAll(Predicate]]> predicate);
}

Thanks,
Krishna

0

Please sign in to leave a comment.