Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Conversion for FixedStatement not implemented

Aperta
#1,101 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp, visualbasic
Ambito
devtools, tooling

Direzione di ricerca

L’issue non indica alcun file sorgente né alcun test; inizia individuando il punto di ingresso del convertitore per FixedStatementSyntax e riproducendo l’input C# fornito. Il lavoro è completato quando le istruzioni fixed non generano più un errore di conversione e producono VB.NET valido con un comportamento del buffer bloccato equivalente a quello dell’output previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C#
Stelle
913
Fork
243
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di icsharpcode/CodeConverter

Tutte le issue di icsharpcode/CodeConverter

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.