Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fb83aa0
Add constructor signature diagnostics
simonrozsival Aug 28, 2026
94a2953
Fix constructor parity test capture
simonrozsival Aug 28, 2026
173582d
Fix constructor diagnostic edge cases
simonrozsival Aug 28, 2026
4f5f7be
Harden constructor diagnostic analysis
simonrozsival Aug 28, 2026
75ab7da
Fix constructor comparison test formatting
simonrozsival Aug 28, 2026
bd19ba4
[typemap] Validate nested constructor shapes
simonrozsival Aug 31, 2026
c7debf7
[tests] Remove vacuous export diagnostic assertion
simonrozsival Aug 31, 2026
11c4bea
[typemap] Suppress secondary constructor diagnostics
simonrozsival Aug 31, 2026
96693e7
[typemap] Collect independent validation errors
simonrozsival Aug 31, 2026
a35870a
[typemap] Track rejected export constructors
simonrozsival Aug 31, 2026
7df69a6
[typemap] Preserve constructor type identity
simonrozsival Aug 31, 2026
cdd3011
[typemap] Recognize Java lambda parameters
simonrozsival Aug 31, 2026
d4c2bf5
[tests] Measure Java super argument forms
simonrozsival Aug 31, 2026
91098ed
[typemap] Preserve framework constructor compatibility
simonrozsival Aug 31, 2026
c319608
[typemap] Preserve explicit export metadata
simonrozsival Aug 31, 2026
d952cb4
[typemap] Validate primitive constructor identity
simonrozsival Aug 31, 2026
b0fb274
[typemap] Deduplicate constructor collisions
simonrozsival Aug 31, 2026
0e30f65
[typemap] Tokenize Java super arguments
simonrozsival Aug 31, 2026
d29e54c
[tests] Cover Java super argument tokens
simonrozsival Aug 31, 2026
f5173f9
[tests] Complete super argument matrix
simonrozsival Aug 31, 2026
a427e67
[tests] Measure explicit constructor metadata
simonrozsival Aug 31, 2026
34cde66
[tests] Mark fixture framework identity
simonrozsival Aug 31, 2026
da6d39f
[typemap] Match base constructors by JNI signature
simonrozsival Aug 31, 2026
6dd076f
[typemap] Resolve activation constructor identity
simonrozsival Aug 31, 2026
4676e33
[typemap] Keep generic lambda bodies scoped
simonrozsival Aug 31, 2026
1ffbf50
[tests] Check complete legacy constructor set
simonrozsival Aug 31, 2026
dffd033
[tests] Use canonical activation assemblies
simonrozsival Aug 31, 2026
febf769
[tests] Cover generic lambda delimiters
simonrozsival Aug 31, 2026
48e2acb
[tests] Record element-mapped legacy constructors
simonrozsival Aug 31, 2026
663a4ab
[typemap] Defer complex super arguments to javac
simonrozsival Aug 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Documentation/docs-mobile/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,14 @@
href: messages/xa4249.md
- name: XA4258
href: messages/xa4258.md
- name: XA4259
href: messages/xa4259.md
- name: XA4260
href: messages/xa4260.md
- name: XA4261
href: messages/xa4261.md
- name: XA4262
href: messages/xa4262.md
- name: XA4263
href: messages/xa4263.md
- name: XA4301
Expand Down
4 changes: 4 additions & 0 deletions Documentation/docs-mobile/messages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ Either change the value in the AndroidManifest.xml to match the $(SupportedOSPla
+ [XA4255](xa4255.md): Generated trimmable type map Java source '{path}' was not found.
+ [XA4256](xa4256.md): Skipping Java peer type '{type}' from assembly '{assembly}' because referenced type '{referencedType}' from assembly '{referencedAssembly}' could not be resolved in '{path}'. This type will not be included in the trimmable type map.
+ [XA4258](xa4258.md): Java name '{name}' contains reserved Java identifier '{identifier}'. Change the package or type name.
+ [XA4259](xa4259.md): Type '{type}' has multiple managed constructors that map to the same Java Native Interface (JNI) signature '{signature}'.
+ [XA4260](xa4260.md): Type '{type}' has a constructor parameter type '{parameterType}' that cannot be represented in a Java constructor.
+ [XA4261](xa4261.md): Type '{type}' has Java constructor signature '{signature}', but its base type does not expose a compatible Java constructor.
+ [XA4262](xa4262.md): Type '{type}' has an invalid [Export] SuperArgumentsString value '{value}'.
+ [XA4263](xa4263.md): The exported member '{member}' has unsupported signature type '{type}'. Use a Java peer type, a supported managed-to-Java mapping, or [ExportParameter].
+ XA4300: Native library '{library}' will not be bundled because it has an unsupported ABI.
+ [XA4301](xa4301.md): Apk already contains the item `xxx`.
Expand Down
23 changes: 23 additions & 0 deletions Documentation/docs-mobile/messages/xa4259.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: .NET for Android error XA4259
description: XA4259 error code
ms.date: 08/28/2026
f1_keywords:
- "XA4259"
---

# .NET for Android error XA4259

## Example message

```text
error XA4259: Type 'Example.MyActivity' has multiple managed constructors that map to the same Java Native Interface (JNI) signature '(I)V'. Change the constructor parameter types so each constructor has a unique JNI signature.
```

## Issue

Two managed constructor parameter lists collapse to the same JNI signature. For example, `int` and `uint` both map to Java `int`, and two managed binding types can alias the same Java type.

## Solution

Remove one constructor or change its parameters so every Java-visible constructor has a unique JNI signature.
23 changes: 23 additions & 0 deletions Documentation/docs-mobile/messages/xa4260.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: .NET for Android error XA4260
description: XA4260 error code
ms.date: 08/28/2026
f1_keywords:
- "XA4260"
---

# .NET for Android error XA4260

## Example message

```text
error XA4260: Type 'Example.MyActivity' has a constructor parameter type 'System.Int32&' that cannot be represented in a Java constructor. Remove the constructor or change the parameter to a supported Java type.
```

## Issue

Java callable wrappers cannot represent generic parameters or instantiations, by-reference types, pointers, function pointers, or rectangular arrays in constructor signatures.

## Solution

Remove the Java-visible constructor or use primitive, string, bound Java object, or single-dimensional array parameters.
23 changes: 23 additions & 0 deletions Documentation/docs-mobile/messages/xa4261.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: .NET for Android error XA4261
description: XA4261 error code
ms.date: 08/28/2026
f1_keywords:
- "XA4261"
---

# .NET for Android error XA4261

## Example message

```text
error XA4261: Type 'Example.MyActivity' has Java constructor signature '(Ljava/lang/String;)V', but its base type does not expose a compatible Java constructor. Add a compatible base constructor or remove the derived constructor.
```

## Issue

The generated Java constructor must invoke a Java constructor on its base type. No compatible base constructor or parameterless fallback is available.

## Solution

Expose a compatible registered constructor on the base type, add a parameterless base constructor, or remove the derived constructor.
23 changes: 23 additions & 0 deletions Documentation/docs-mobile/messages/xa4262.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: .NET for Android error XA4262
description: XA4262 error code
ms.date: 08/28/2026
f1_keywords:
- "XA4262"
---

# .NET for Android error XA4262

## Example message

```text
error XA4262: Type 'Example.MyActivity' has an invalid [Export] SuperArgumentsString value 'p1'. The value references a constructor parameter that does not exist.
```

## Issue

`SuperArgumentsString` references a generated Java constructor parameter outside the available `p0`, `p1`, and subsequent parameter range.

## Solution

Correct the parameter reference or remove `SuperArgumentsString` to forward all constructor parameters to the Java base constructor.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ void LogUnresolvableJavaPeerSkippedWarning (
void LogExportFieldOnGenericTypeError ();
void LogExportFieldReturnsVoidError ();
void LogUnsupportedExportSignatureError (string memberName, string managedTypeName);
void LogAmbiguousConstructorSignatureError (string managedTypeName, string jniSignature);
void LogUnsupportedConstructorParameterTypeError (string managedTypeName, string parameterType);
void LogMissingBaseConstructorError (string managedTypeName, string jniSignature);
void LogInvalidSuperArgumentsStringError (string managedTypeName, string superArgumentsString);
void LogCustomJavaObjectError (string managedTypeName);
void LogCustomJavaObjectWarning (string managedTypeName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ public sealed record JavaPeerInfo
/// </summary>
public IReadOnlyList<JavaConstructorInfo> JavaConstructors { get; init; } = [];

/// <summary>
/// Constructor shapes which cannot be emitted safely by the trimmable type map.
/// Generation reports these before producing any Java or type-map output.
/// </summary>
public IReadOnlyList<ConstructorDiagnosticInfo> ConstructorDiagnostics { get; init; } = [];

/// <summary>
/// Java fields from [ExportField] attributes.
/// Each field is initialized by calling the annotated method.
Expand Down Expand Up @@ -384,6 +390,20 @@ public sealed record JavaConstructorInfo
public IReadOnlyList<JavaAnnotationInfo> Annotations { get; init; } = [];
}

public sealed record ConstructorDiagnosticInfo
{
public required ConstructorDiagnosticKind Kind { get; init; }
public required string Detail { get; init; }
}

public enum ConstructorDiagnosticKind
{
AmbiguousJniSignature,
UnsupportedParameterType,
MissingBaseConstructor,
InvalidSuperArgumentsString,
}

/// <summary>
/// Describes a Java field from an [ExportField] attribute.
/// The field is initialized by calling the annotated method.
Expand Down
Loading
Loading