tags:

views:

87

answers:

2

Ok - I feel stupid but if I type a variable Resharper highlights the variable RED and then suggests split declaration and assignment

Now I want this suggestion but I do not want the variable to be red

Is there any way to remove this

I ve looked through all the options and still cannot figure this out

public static void Add<S, D>(List<S> source, List<D> destination) 
where D : class 
{ 
    foreach (S sourceElement in source) 
    { 
        destination.Add(sourceElement); 
    }
}

EDIT: My problems seems to be the exact same thing as http://stackoverflow.com/questions/1766810/resharper-suggestion-color-issue - I cannot download SP2 VS 2005.

Basically some variables are having red as BACKGROUND

Is there any other option I can use?

+2  A: 

You should be able to set the severity in Menu -> Resharper -> Options -> Code Inspection -> Inspection severity.

Jonas Lincoln
Yes thats correct - However a suggestion makes the background of the variable all red which is driving me nuts!!
ChloeRadshaw
See my edit above please
ChloeRadshaw
A: 

No, the error comes from the fact that you try to assign D to S and there's no conversion possible

Add another constraint and solve error :

 public static void Add<S, D>(List<S> source, List<D> destination)
  where D : class
  where S : D  /*Solve the assignment issue */
 {
  foreach (S sourceElement in source) { destination.Add(sourceElement); }
 }
Florian Doyon