none
Why MgdArr[i32] just has 11 base types? why it no System.Cpllections.Generic.IReadOnlyList'1<System.Int32>? RRS feed

  • Question

  • Hi Guys,

    Somebody of you who can help me reslove the probelm below? thanks very much in advance!

    For .NET4.5,

    How many base types in MgdArr[i32]?

    How many base types in System.Int32[]?

    I get the below picture, that's right? and could you please why they have the different in .NET4.5?

    For picture_1 code:

                // Create the list of base types for the runtime type
                List<string> baseTypes = new List<string>();
                baseTypes.Add(runtimeType.BaseType.FullName);
                foreach (SystemType iface in runtimeType.GetInterfaces())
                {
                    baseTypes.Add(GetTypeName(iface));
                }

    For picture_2 code:

    // Create the list of base types for the Phoenix type from code

    //public int[] IntArray = new int[1]; // TODO: PHXAPI: There is no easy way to get the complete list

    //of implemented interfaces List<string> phxBaseTypes = new List<string>(); AddBaseTypes(phxBaseTypes, phxArrayType); phxBaseTypes.Remove("System.Object");


    Monday, June 11, 2012 10:16 AM

Answers

  • "How many base types in MgdArr[i32]?"

    I don't know what MgdArr[i32] is, I suppose it's a Phoenix type that coresponds to System.Int32[]. But I can't say I used Phoenix so...

    "How many base types in System.Int32[]?"

    Strictly speaking there's only one base type because .NET only does single inheritance, the rest of the "base types" are interface implementations. Anyway, I did a test and as far as I can tell int[] doesn't implement IReadOnlyCollection/IReadOnlyList, I don't know where you got that list you're showing in the picture to the left. The picture to the top-right has the correct list for .NET 4 and .NET 4.5. For .NET 2.0 the 2 IStructural* interfaces do not exist.

    Tuesday, June 12, 2012 6:25 AM
    Moderator

All replies

  • "I get the below picture, that's right? and could you please why they have the different in .NET4.5? "

    IReadOnlyList and IReadOnlyCollection are new to .NET 4.5.

    Monday, June 11, 2012 2:34 PM
    Moderator
  • And could you please answer the two question below?

    How many base types in MgdArr[i32]?

    How many base types in System.Int32[]?

    Tuesday, June 12, 2012 1:13 AM
  • "How many base types in MgdArr[i32]?"

    I don't know what MgdArr[i32] is, I suppose it's a Phoenix type that coresponds to System.Int32[]. But I can't say I used Phoenix so...

    "How many base types in System.Int32[]?"

    Strictly speaking there's only one base type because .NET only does single inheritance, the rest of the "base types" are interface implementations. Anyway, I did a test and as far as I can tell int[] doesn't implement IReadOnlyCollection/IReadOnlyList, I don't know where you got that list you're showing in the picture to the left. The picture to the top-right has the correct list for .NET 4 and .NET 4.5. For .NET 2.0 the 2 IStructural* interfaces do not exist.

    Tuesday, June 12, 2012 6:25 AM
    Moderator