You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicclassCSharpClass{publicstaticvoidMain(){byte[]bytes=[1,2,3];
fixed (byte*bufferPtr=bytes){Console.WriteLine($"The address of the first array element: {(long)bufferPtr:X}.");Console.WriteLine($"The value of the first array element: {*bufferPtr}.");}}}
Erroneous output
PublicClassCSharpClassPublicSharedSubMain()IfTrueThenDimbytesAsByte()= _(1,2,3)''' Cannot convert FixedStatementSyntax, CONVERSION ERROR: Conversion for FixedStatement not implemented, please report this issue in 'fixed (byte* bufferPtr = by...' at character 91''' ''' ''' Input:''' fixed (byte* bufferPtr = bytes)''' {''' Console.WriteLine($"The address of the first array element: {(long)bufferPtr:X}.");''' Console.WriteLine($"The value of the first array element: {*bufferPtr}.");''' }''' ''' EndIfEndSubEndClass
Expected output
ImportsSystemImportsSystem.Runtime.InteropServicesModuleProgramPublicSharedSubMain()DimbytesAsByte()={1,2,3}DimbufferHandleAsGCHandle=GCHandle.Alloc(bytes,GCHandleType.Pinned)TryDimbufferPtrAsIntPtr=bufferHandle.AddrOfPinnedObject()Console.WriteLine($"The address of the first array element: {bufferPtr.ToInt64():X}.")Console.WriteLine($"The value of the first array element: {Marshal.ReadByte(bufferPtr)}.")FinallybufferHandle.Free()EndTryEndSubEndModule
Please fill in the template correctly. It is unlikely that somebody is able to help you with so little information.
GrahamTheCoder
changed the title
CONVERSION ERROR: Conversion for FixedStatement not implemented, please report this issue in 'fixed (byte* bufferPtr = bu...' at character 18915 CONVERSION ERROR: Conversion for FixedStatement not implemented, please report this issue in 'fixed (byte* bufferPtr = bu...' at character 23017C# -> VB: _Add a short description_
Conversion for FixedStatement not implemented
Jul 16, 2024
I've added my best guess at an input and expected output. A real example would help, though there are currently no contributors interested in implementing C#->VB features.
Input code
In unsafe context
Erroneous output
Expected output
Details
The text was updated successfully, but these errors were encountered: