true and false operator overloads and implicit operators

2 posts, 0 answers
  1. Aleksander
    Aleksander avatar
    1 posts
    Member since:
    Nov 2011

    Posted 23 Jan 2012 Link to this post

    Simply put, JustDecompile does not yet recognize the true and false operators used in C#. You can do public static bool operator true(MyType t) {/* implementation */} and same with false. This results in IL: 
    .method public hidebysig specialname static
        bool op_True (
            class Test.MyType obj
        ) cil managed
    However, when decompiled to C# it shows up as:
    public static bool op_True(TotemValue value);
    Also, when used the operator shows up like this:
    // Original code
    if(myObj) /*stuff*/
     
    // Decompiled code
    if(MyType.op_True(myObj)) /* stuff */
    The last point is also valid for implicit operators where they show up as MyType.op_Implicit (haven't tried explicit ones yet).
  2. Vladi
    Admin
    Vladi avatar
    167 posts

    Posted 24 Jan 2012 Link to this post

    Hi Aleksander,

    Many thanks for your bug report. I've logged it and we will provide a fix for it soon. Please stay tuned and continue sending us your feedback. It's much appreciated!

    Greetings,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top