[xcode11] [Generator] Do not used harcoded 'error' var name, use the one in the declaration. (#6637)

This commit is contained in:
monojenkins 2019-07-24 07:28:07 -04:00 коммит произвёл Manuel de la Pena
Родитель 0cab45b799
Коммит 0443822a3f
3 изменённых файлов: 21 добавлений и 1 удалений

Просмотреть файл

@ -1712,7 +1712,7 @@ public partial class Generator : IMemberGatherer {
var refname = $"__xamarin_pref{pi.Position}";
convert.Append ($"var {refname} = Runtime.GetINativeObject<{RenderType (nt)}> ({pname}, false);");
pars.Append ($"ref IntPtr {pname}");
postConvert.Append ($"error = {refname}.GetHandle ();");
postConvert.Append ($"{pname} = {refname} == null ? IntPtr.Zero : {refname}.Handle;");
invoke.Append ($"ref {refname}");
continue;
}

Просмотреть файл

@ -592,6 +592,9 @@ namespace GeneratorTests
BuildFile (Profile.iOS, "tests/return-release.cs");
}
[Test]
public void GHIssue6626 () => BuildFile (Profile.iOS, "ghissue6626.cs");
BGenTool BuildFile (Profile profile, params string [] filenames)
{
return BuildFile (profile, true, false, filenames);

Просмотреть файл

@ -0,0 +1,17 @@
using System;
using Foundation;
using AudioToolbox;
using ObjCRuntime;
namespace GHIssue6626 {
public delegate int AVAudioSourceNodeRenderBlock (bool isSilence, double timestamp, uint frameCount, ref AudioBuffers outputData);
[BaseType (typeof (NSObject))]
interface AVAudioSourceNode
{
[Export ("initWithRenderBlock:")]
[DesignatedInitializer]
IntPtr Constructor (AVAudioSourceNodeRenderBlock block);
}
}