Your class is clearly NOT the same type as either of the parameters in the operator. By design you cannot extend or override operators for the System defined Types of the .NET Framework. In your case 'List'.
I wouldn't mind but
others seriously do[
^]. C# is used a lot in platform development and arguments differ from those of a scripting language in a FastCGI environment.
Anyways, try:
void Main()
{
var x = new LD_L<string>(){"a"};
var y = new LD_L<string>(){"b"};
var z = x+y;
}
class LD_L<LD_L_Entry> : List<LD_L_Entry>
{
public static LD_L<LD_L_Entry> operator + (LD_L<LD_L_Entry> A,LD_L<LD_L_Entry> B)
{
Console.WriteLine("foo and bar were pluzz-oped: " + A.GetType().ToString() + "+" + B.GetType().ToString());
return null;
}
}
Result:
foo and bar were pluzz-oped: UserQuery+LD_L`1[System.String]+UserQuery+LD_L`1[System.String]
Note:
You do not need .GetType().ToString(), .ToString() would suffice.