[IronPython] unsupported operand type(s) for & operator overloading.

李兵 dreamwinterlb at gmail.com
Wed May 13 05:05:09 CEST 2009


Hi,
   I implemented '&' operator overloading in C# class.  But When I used
ScriptRuntime compile the expression that use '&' operator, I got a
exception 'unsupported operand type(s) for & operator overloading'.
The following is C# code.

      public static  Group operator &(Condition left, Condition right) {
            if (left == null) {
                throw new ArgumentNullException("left");
            }
            if (right == null) {
                throw new ArgumentNullException("right");
            }
             Group re = new  Group(left, right, LogicalOperator.And);
            return re;
        }

IronPython expression like this ' A.Create("Audit") ==  A.Create("Test1") &
A.CreateProperty("Sum") == A.Create("Test2") '

I tried to convert '&' to 'and'. Although no exception, I lost the left
expression.

Anyone can help me? Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090513/d9c224a7/attachment.html>


More information about the Ironpython-users mailing list