Skip to content

[AsmDiff] - Does not detect nint andnuint #8484

Closed as not planned
Closed as not planned

Description

@carlossanlop
  • This issue is blocking
  • This issue is causing unreasonable pain

When the tool generates a diff between two .NET versions, any APIs with nint or nuint in their signature unexpectedly show IntPtr or UIntPtr instead, as described here: dotnet/core#7211 (comment)

Activity

  1. michellemcdaniel commented on Feb 24, 2022

    @michellemcdaniel
    Contributor

    @ericstj Do you have context on this?

  2. ericstj commented on Feb 28, 2022

    @ericstj
    Member

    This is in tooling maintained by @dotnet/area-infrastructure-libraries. This is due to the way these tools are built off of metadata. Whenever a language change comes around they need to be updated if we want them to reflect that language feature.

    Places of interest to look at are:
    https://github.com/microsoft/cci/blob/659f31f9736a1e8ded870ee2132d91f87505148e/SourceEmitters/VB/VBSourceEmitter/BaseSourceEmitter.cs#L623
    -- We don't update CCI so we couldn't change this.

    Perhaps we need changes here:

    public static string GetTypeName(this ITypeReference type, bool includeNamespace = true)
    {
    TypeNameFormatter formatter = new TypeNameFormatter();
    NameFormattingOptions options = NameFormattingOptions.OmitTypeArguments | NameFormattingOptions.UseReflectionStyleForNestedTypeNames;
    if (!includeNamespace)
    options |= NameFormattingOptions.OmitContainingNamespace;
    string name = formatter.GetTypeName(type, options);
    return name;
    }
    public static string GetTypeName(this ITypeReference type, NameFormattingOptions options)
    {
    TypeNameFormatter formatter = new TypeNameFormatter();
    string name = formatter.GetTypeName(type, options);
    return name;
    }

    Perhaps also here, if these are new keywords:
    private static Regex s_isKeywordRegex;
    public static bool IsKeyword(string s)
    {
    if (s_isKeywordRegex == null)
    s_isKeywordRegex = new Regex("^(abstract|as|break|case|catch|checked|class|const|continue|default|delegate|do|else|enum|event|explicit|extern|finally|foreach|for|get|goto|if|implicit|interface|internal|in|is|lock|namespace|new|operator|out|override|params|partial|private|protected|public|readonly|ref|return|sealed|set|sizeof|stackalloc|static|struct|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while|yield|bool|byte|char|decimal|double|fixed|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void)$", RegexOptions.Compiled);
    return s_isKeywordRegex.IsMatch(s);
    }

    cc @tannergooding

  3. tannergooding commented on Feb 28, 2022

    @tannergooding
    Member

    Perhaps also here, if these are new keywords:

    They are contextual keywords (like "var"), not "proper" keywords.

  4. ViktorHofer commented on May 19, 2026

    @ViktorHofer
    Member

    Closing as AsmDiff got removed from arcade, rewritten and now lives in dotnet/sdk: https://github.com/dotnet/sdk/tree/main/src/Compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions