Skip to content

[Java.Interop.Tools.JavaCallableWrappers] [Export]+params #1161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void AddConstructor (MethodDefinition ctor, TypeDefinition type, string? outerTy
if (!string.IsNullOrEmpty (eattr.Name)) {
// Diagnostic.Warning (log, "Use of ExportAttribute.Name property is invalid on constructors");
}
ctors.Add (new Signature (ctor, eattr, cache));
ctors.Add (new Signature (ctor, eattr, managedParameters, cache));
curCtors.Add (ctor);
return;
}
Expand Down Expand Up @@ -481,7 +481,7 @@ void AddMethod (MethodDefinition? registeredMethod, MethodDefinition implemented
if (type.HasGenericParameters)
Diagnostic.Error (4206, LookupSource (implementedMethod), Localization.Resources.JavaCallableWrappers_XA4206);

var msig = new Signature (implementedMethod, attr, cache);
var msig = new Signature (implementedMethod, attr, managedParameters: null, cache: cache);
if (!string.IsNullOrEmpty (attr.SuperArgumentsString)) {
// Diagnostic.Warning (log, "Use of ExportAttribute.SuperArgumentsString property is invalid on methods");
}
Expand Down Expand Up @@ -834,14 +834,15 @@ public Signature (MethodDefinition method, RegisterAttribute register, string? m
IsDynamicallyRegistered = shouldBeDynamicallyRegistered;
}

public Signature (MethodDefinition method, ExportAttribute export, IMetadataResolver cache)
public Signature (MethodDefinition method, ExportAttribute export, string? managedParameters, IMetadataResolver cache)
: this (method.Name, GetJniSignature (method, cache), "__export__", null, null, export.SuperArgumentsString)
{
IsExport = true;
IsStatic = method.IsStatic;
JavaAccess = JavaCallableWrapperGenerator.GetJavaAccess (method.Attributes & MethodAttributes.MemberAccessMask);
ThrownTypeNames = export.ThrownNames;
JavaNameOverride = export.Name;
ManagedParameters = managedParameters;
Annotations = JavaCallableWrapperGenerator.GetAnnotationsString ("\t", method.CustomAttributes, cache);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public ExportsConstructors (int p0)
{
super (p0);
if (getClass () == ExportsConstructors.class) {
mono.android.TypeManager.Activate (""Xamarin.Android.ToolsTests.ExportsConstructors, Java.Interop.Tools.JavaCallableWrappers-Tests"", """", this, new java.lang.Object[] { p0 });
mono.android.TypeManager.Activate (""Xamarin.Android.ToolsTests.ExportsConstructors, Java.Interop.Tools.JavaCallableWrappers-Tests"", ""System.Int32, System.Private.CoreLib"", this, new java.lang.Object[] { p0 });
}
}

Expand Down Expand Up @@ -505,7 +505,7 @@ public ExportsThrowsConstructors (int p0) throws java.lang.Throwable
{
super (p0);
if (getClass () == ExportsThrowsConstructors.class) {
mono.android.TypeManager.Activate (""Xamarin.Android.ToolsTests.ExportsThrowsConstructors, Java.Interop.Tools.JavaCallableWrappers-Tests"", """", this, new java.lang.Object[] { p0 });
mono.android.TypeManager.Activate (""Xamarin.Android.ToolsTests.ExportsThrowsConstructors, Java.Interop.Tools.JavaCallableWrappers-Tests"", ""System.Int32, System.Private.CoreLib"", this, new java.lang.Object[] { p0 });
}
}

Expand All @@ -514,7 +514,7 @@ public ExportsThrowsConstructors (java.lang.String p0)
{
super (p0);
if (getClass () == ExportsThrowsConstructors.class) {
mono.android.TypeManager.Activate (""Xamarin.Android.ToolsTests.ExportsThrowsConstructors, Java.Interop.Tools.JavaCallableWrappers-Tests"", """", this, new java.lang.Object[] { p0 });
mono.android.TypeManager.Activate (""Xamarin.Android.ToolsTests.ExportsThrowsConstructors, Java.Interop.Tools.JavaCallableWrappers-Tests"", ""System.String, System.Private.CoreLib"", this, new java.lang.Object[] { p0 });
}
}

Expand Down