Skip to content

[TrimmableTypeMap] Enable deferred Export device coverage for JCW-only shapes #11289

Open

Description

@simonrozsival

Summary

PR #11123 adds trimmable [Export] / [ExportField] scanner, generator, and runtime dispatch support, but several end-to-end device test shapes are intentionally deferred because they currently fail before reaching the trimmable runtime path.

This issue tracks the focused follow-up needed to enable those device tests.

Missing device coverage

tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/ExportTests.cs currently enables 9 [Export] device tests. The following shapes remain covered only by host scanner/emitter tests and need end-to-end runtime tests once the JCW side can build them:

  • enum [Export] parameter/return shapes
  • Java.Lang.ICharSequence [Export] parameter/return shapes
  • non-generic collection [Export] parameter/return shapes (IList, IDictionary, ICollection)
  • [ExportField] runtime visibility/initialization shapes

Current blocker

The generated Java callable wrapper path rejects or mishandles some of these shapes before runtime validation can execute:

  • CecilImporter.GetJniSignature returns null for some managed enum, ICharSequence, and non-generic collection shapes while generating Java callable wrappers, causing the app build to fail before the trimmable export dispatch path can be exercised.
  • [ExportField] needs separate JCW field-initializer work before runtime coverage is meaningful; current field initialization can call the exported method with the wrong static/instance shape.

Expected outcome

After fixing the JCW side:

  1. Add the deferred device tests to ExportTests.cs.
  2. Verify they pass for the legacy typemap path that defines the contract.
  3. Verify they pass for _AndroidTypeMapImplementation=trimmable + UseMonoRuntime=false.
  4. Update PR/issue references so the host scanner/emitter coverage and device coverage are aligned.

Related: #10788, #10933, #11123.

Activity

  1. added
    needs-triage
    on May 5, 2026
  2. added this to the .NET 12 milestone on Aug 13, 2026
  3. added
    bug
    Area: Unit Tests
    and removed
    needs-triage
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Unit Testsbugtrimmable-type-map

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions