Skip to content

ModuleBuilder.GetType does not work with ignore case with certain unicode chars on Unix #18231

Closed

Description

@hughbe

The following test passes on Windows, but fails on non-Windows platforms, discovered in dotnet/corefx#10532

[Fact]
public void Test()
{
    AssemblyBuilder assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("AssemblyName"), AssemblyBuilderAccess.Run);
    ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule("ModuleName");

    TypeBuilder type = moduleBuilder.DefineType("\uD800\uDC00");
    TypeInfo createdType = type.CreateTypeInfo();

    moduleBuilder.GetType("\uD800\uDC00", false, false); // Works on all platforms
    moduleBuilder.GetType("\uD800\uDC00", true, false); // Works on all platforms

    moduleBuilder.GetType("\uD800\uDC00", true, true); // Throws TypeLoadException on Unix
    moduleBuilder.GetType("\uD800\uDC00".ToLowerInvariant(), true, true); // Throws TypeLoadException on Unix
    moduleBuilder.GetType("\uD800\uDC00".ToUpperInvariant(), true, true); // Throws TypeLoadException on Unix}

/cc @stephentoub @atsushikan

Activity

  1. changed the title [-]ModuleBuilder.GetType does not work with ignore case with certain unicode chars on XPlat[/-] [+]ModuleBuilder.GetType does not work with ignore case with certain unicode chars on Unix[/+] on Aug 19, 2016
  2. stephentoub commented on Aug 19, 2016

    @stephentoub
    Member
  3. tarekgh commented on Sep 1, 2016

    @tarekgh
    Member

    @atsushikan please have a look and if you see the issue is globalization I will help with it. Thanks.

  4. tarekgh commented on Sep 23, 2016

    @tarekgh
    Member

    moved it to 1.2 as this is rare scenario to support surrogate pairs in types names

  5. removed their assignment
    on Nov 23, 2016
  6. karelz commented on Feb 28, 2017

    @karelz
    Member

    Next step: Find out (under debugger) where we invoke globalization and get the wrong answer (that's where it is likely going to be).

  7. transferred this issue fromdotnet/corefxon Jan 31, 2020
  8. added this to the Future milestone on Jan 31, 2020
  9. added
    untriaged
    on Feb 23, 2020
  10. removed
    untriaged
    on Apr 1, 2020
  11. 4 remaining items

  12. modified the milestones: 6.0.0, 7.0.0 on Jun 17, 2021
  13. ghost added
    in-pr
    on Jun 1, 2022
  14. ghost removed
    in-pr
    on Jun 1, 2022
  15. added
    area-VM-reflection-mono
    and removed on Jun 1, 2022
  16. ghost added
    in-pr
    on Jun 2, 2022
  17. Repository owner moved this from Future to Done in Triage POD for Reflection, META, etc.on Jun 2, 2022
  18. ghost removed
    in-pr
    on Jun 2, 2022
  19. ghost locked as resolved and limited conversation to collaborators on Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-VM-reflection-monobugdisabled-testos-linux

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions