Skip to content

Stop generating dead Java.Interop.__TypeRegistrations#11664

Closed
Copilot wants to merge 10 commits into
mainfrom
copilot/stop-generating-dead-type-registrations-class
Closed

Stop generating dead Java.Interop.__TypeRegistrations#11664
Copilot wants to merge 10 commits into
mainfrom
copilot/stop-generating-dead-type-registrations-class

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

The binding generator still emitted Java.Interop.__TypeRegistrations, but the runtime fallback that consumed it has been removed. The generated class and its package lookup registrations are now dead code in every binding assembly.

  • Generator
    • Removed the __TypeRegistrations generation call.
    • Deleted the generator implementation that wrote RegisterPackages(), Lookup(...), and per-package lookup converters.
// Removed from generation flow:
ClassGen.GenerateTypeRegistrations (opt, gen_info);
  • Generator baselines

    • Removed Java.Interop.__TypeRegistrations.cs from expected.xaji fixtures.
    • Removed corresponding Mono.Android.projitems compile entries.
  • Runtime compatibility

    • Removed unused package lookup storage and mutation.
    • Kept shipped Java.Interop.TypeManager registration APIs as compatibility no-ops.
    • Preserved existing argument validation behavior for retained public methods.

Copilot AI and others added 3 commits June 16, 2026 08:33
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Copilot AI changed the title [WIP] Stop generating dead Java.Interop.__TypeRegistrations class Stop generating dead Java.Interop.__TypeRegistrations Jun 16, 2026
Copilot AI requested a review from simonrozsival June 16, 2026 08:40

@simonrozsival simonrozsival left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot address this code review

packageLookup = new Dictionary<string, List<Converter<string, Type?>>> (StringComparer.Ordinal);
}

public static void RegisterPackage (string package, Converter<string, Type> lookup)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method should throw NotSupportedException

throw new ArgumentNullException ("lookup");
}

public static void RegisterPackages (string[] packages, Converter<string, Type?>[] lookups)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method should throw NotSupportedException

@simonrozsival simonrozsival left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot it's necessary to open a PR in the dotnet/java-interop repo with the generator changes

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@simonrozsival I've opened a new pull request, #11666, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 6 commits June 16, 2026 09:03
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Copilot stopped work on behalf of simonrozsival due to an error June 16, 2026 09:09
Copilot AI requested a review from simonrozsival June 16, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants