Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 452 Bytes

MA0146.md

File metadata and controls

19 lines (16 loc) · 452 Bytes

MA0146 - Name must be set explicitly on local functions

Local function names are mangle by the compiler, so the Name named constructor parameter is required

// non compliant
void Sample()
{
    [UnsafeAccessor(UnsafeAccessorKind.Field)]
    extern static ref int _Major_(System.Version a);
}

// Ok
void Sample()
{
    [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_Major")]
    extern static ref int _Major_(System.Version a);
}