Bug in decompiling string cast to object

2 posts, 0 answers
  1. Joe
    Joe avatar
    1 posts
    Member since:
    Sep 2010

    Posted 27 Jun 2013 Link to this post

    There's some invalid decompiled C# in a specific case:

    bool a1 = (object)("string" + 1) == ("string" + 1);

    This shows in JustDecompile as:

    bool a1 = string.Concat("string", 1) == string.Concat("string", 1);

    The problem is that the original code will check reference equality because of the cast to object, returning false, while the decompiled code checks string equality, and returns true.
  2. Momchil
    Momchil avatar
    31 posts

    Posted 01 Jul 2013 Link to this post


    Thanks for pointing us this issue. It has been logged and we will be working on it in one of our future releases.

    Please, do not hesitate to send us any other feedback or issue report you stumble upon.

    Tell us what you think about JustDecompile. Your opinion matters! You can use our forum, or our JustDecompile UserVoice website for feature requests.
  3. DevCraft banner
Back to Top