Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,7 @@ private static void WriteSignatureForFunctionPointerType(SignatureTypeEncoder si
if (returnType.GetRequiredCustomModifiers() is Type[] retModReqs)
WriteCustomModifiers(retModifiersEncoder, retModReqs, isOptional: false, module);

Type returnTypeToWrite = returnType;
if (!returnTypeToWrite.IsFunctionPointer)
returnTypeToWrite = returnTypeToWrite.UnderlyingSystemType;

WriteSignatureForType(retTypeEncoder.Type(), returnTypeToWrite, module);
WriteSignatureForType(retTypeEncoder.Type(), returnType, module);

foreach (Type paramType in paramTypes)
{
Expand All @@ -293,16 +289,13 @@ private static void WriteSignatureForFunctionPointerType(SignatureTypeEncoder si
if (paramType.GetRequiredCustomModifiers() is Type[] paramModReqs)
WriteCustomModifiers(paramModifiersEncoder, paramModReqs, isOptional: false, module);

Type paramTypeToWrite = paramType;
if (!paramTypeToWrite.IsFunctionPointer)
paramTypeToWrite = paramTypeToWrite.UnderlyingSystemType;

WriteSignatureForType(paramEncoder.Type(), paramTypeToWrite, module);
WriteSignatureForType(paramEncoder.Type(), paramType, module);
}
}

private static void WriteSimpleSignature(SignatureTypeEncoder signature, Type type, ModuleBuilderImpl module)
{
type = type.UnderlyingSystemType;
CoreTypeId? typeId = module.GetTypeIdFromCoreTypes(type);

switch (typeId)
Expand Down
Loading