Skip to content

[Mono] Type.GetNestedTypes bug #122437

@srxqds

Description

@srxqds

Description

 Type dictConcrete = typeof(Dictionary<int, int>);
Type[] concreteNestedTypes = dictConcrete.GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic);

foreach (var type in concreteNestedTypes)
{
    Console.WriteLine($"nestedType {type}");
}

the code show print different between coreclr and mono:

coreclr:

nestedType System.Collections.Generic.Dictionary`2+Entry[System.Int32,System.Int32]
nestedType System.Collections.Generic.Dictionary`2+Enumerator[System.Int32,System.Int32]
nestedType System.Collections.Generic.Dictionary`2+KeyCollection[System.Int32,System.Int32]
nestedType System.Collections.Generic.Dictionary`2+ValueCollection[System.Int32,System.Int32]
nestedType System.Collections.Generic.Dictionary`2+KeyCollection+Enumerator[System.Int32,System.Int32]
nestedType System.Collections.Generic.Dictionary`2+ValueCollection+Enumerator[System.Int32,System.Int32]

mono:

nestedType System.Collections.Generic.Dictionary`2+Entry
nestedType System.Collections.Generic.Dictionary`2+Enumerator
nestedType System.Collections.Generic.Dictionary`2+KeyCollection
nestedType System.Collections.Generic.Dictionary`2+ValueCollection
...

Reproduction Steps

it is easy reproducted

Expected behavior

work correctly with coreclr

Actual behavior

wrong behaviour

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-VM-reflection-monoReflection issues specific to MonoVMuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions