dotnet / dotnet/dotnet-api-docs

Modreq usage of `UnmanagedType` type should be documented

Aperta
#7,783 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

area-System.Runtime.InteropServices Pri3 untriaged
Lingua principale
C#
Stelle
950
Fork
1.7k
Merge medio
2g 19h
PR unite (30g)
52

Descrizione

Issue description

The code following C# code

public void UnmanagedT<T>() where T : unmanaged { }

generates the following IL code:

.method public hidebysig 
instance void UnmanagedT<valuetype .ctor (class [mscorlib]System.ValueType modreq([mscorlib]System.Runtime.InteropServices.UnmanagedType)) T> () cil managed 
{
.param type T
    .custom instance void System.Runtime.CompilerServices.IsUnmanagedAttribute::.ctor() = (
        01 00 00 00
    )
.maxstack 8
IL_0000: ret
}

which expect any compilers wanting to use the method to know that the type parameter T has to meet certain requirements.

With the System.Runtime.CompilerServices.IsVolatile type it is documented how & what the modreq does, it should be the same here. It would also be good if System.Runtime.CompilerServices.IsExternalInit (and any others missing it) got the same documentation.

I'm looking on https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.unmanagedtype?view=net-6.0.

Target framework

  • .NET Core 1.0+
  • .NET Framework 1.1+
  • .NET Standard 1.1+

Guida per i contributori

Apri la guida per i contributori

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.

Direzione di ricerca

Inizia dalla documentazione API collegata di UnmanagedType e confrontala con la documentazione esistente di System.Runtime.CompilerServices.IsVolatile. Documenta in che modo modreq comunica il requisito del parametro di tipo unmanaged e verifica se anche IsExternalInit o altri tipi correlati necessitano di una documentazione equivalente; il lavoro è completato quando i riferimenti API pertinenti spiegano questo comportamento.

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

Valutazione

Stack tecnologico
csharp
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.