Invalid C# code generated for nested Enum

2 posts, 1 answers
  1. Chris
    Chris avatar
    12 posts
    Member since:
    May 2011

    Posted 06 Nov 2011 Link to this post

    JustDecompile version 2011.2.1017.4

    It seems that enums nested in a generic type decompile to invalid C# code (VB as well). For example, decompiling System.Collections.Concurrent.BlockingCollection<T>, you will find a nested enum called OperationMode, which the current version of JustDecompile decompiles to

    private enum OperationMode<T>

    The <T> should not be part of the name, even though in the IL it is part of the name.

    Btw. looking at the IL for enums, I also noticed that the enum is missing the declaration for value__, and also the explicit value assigned to the members are not shown. It might be worth showing the the members as the complete IL definition? 


    .field public static literal valuetype System.Collections.Concurrent.BlockingCollection`1/OperationMode<!T> Add = int32(0)

  2. Answer
    Yordan Dikov
    Yordan Dikov avatar
    69 posts

    Posted 09 Nov 2011 Link to this post

    Hi Chris,

    Thanks for the report. Once again this is a corner case we haven't stumbled upon before. Nevertheless we've logged the bugs you pointed out. And I've also updated your Telerik points.

    In regard of showing the missing declarations of enum members in IL, until we fix the way we write those you can select the enum's fields in the tree-view on the left and see their complete IL.

    All the best,
    Yordan Dikov
    the Telerik team

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

  3. DevCraft banner
Back to Top