So these two methods have the same signature but different limitations
public static void Method<T>(ref T variable) where T : struct { } public static void Method<T>(ref T variable) where T : class { }
But they cannot be defined in the same class because they have the same signature. But in this particular case, they are mutually exclusive. (If I am not mistaken in this)
I understand that in addition to class
and struct
you can add additional restrictions, but you cannot specify both struct
and class
in the same way. So why is this not compiling?
source share