Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Conversion for FixedStatement not implemented

Abierto
#1,101 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp, visualbasic
Área
devtools, tooling

Línea de trabajo

El issue no nombra ningún archivo fuente ni prueba; empieza por localizar el punto de entrada del convertidor para FixedStatementSyntax y reproducir la entrada de C# proporcionada. Se considera terminado cuando las instrucciones fixed ya no generan un error de conversión y producen un VB.NET válido con un comportamiento del búfer fijado equivalente al de la salida esperada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

C# -> VB
Input code

In unsafe context

public class CSharpClass
{
    public static void Main(){
        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
Public Class CSharpClass
    Public Shared Sub Main()

        If True Then
            Dim bytes As Byte() = _(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}.");
'''     }
''' 
''' 
        End If
    End Sub
End Class

Expected output
Imports System
Imports System.Runtime.InteropServices

Module Program
    Public Shared Sub Main()
        Dim bytes As Byte() = {1, 2, 3}
        
        Dim bufferHandle As GCHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned)
        Try
            Dim bufferPtr As IntPtr = 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)}.")
        Finally
            bufferHandle.Free()
        End Try
    End Sub
End Module
Details
  • Product in use: e.g. icsharpcode.github.io/CodeConverter / VS extension / both
  • Version in use: e.g. 5.6.3 or a commit hash (if it's a 3rd party tool using this library, try one of the above)
  • Did you see it working in a previous version, which?
  • Any other relevant information to the issue, or your interest in contributing a fix.
Lenguaje dominante
C#
Estrellas
914
Forks
242
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de icsharpcode/CodeConverter

Todos los issues de icsharpcode/CodeConverter

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.