I have this function
public static implicit operator MyClass(string v) { return new MyClass(v); }
and write var.myclass = null;. This calls the implicit operator and passes null as string, which causes havoc in my code (i use reflection and would not like to add a special case). How can i write myclass = null without causing the implicit operator?
I tried writing
public static implicit operator MyClass(string v) { return v == null ? null : new MyClass(v); }
But that causes a stackoverflow