dotnet/roslyn

SourceFieldSymbol.HasRuntimeSpecialName should check that containing type is enum

Aperta

#23.058 aperta il 7 nov 2017

 (0 commenti) (0 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-CompilersBughelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

It feels like we should at least check that the containing type is an enum.

        internal sealed override bool HasRuntimeSpecialName
        {
            get
            {
                return this.Name == WellKnownMemberNames.EnumBackingFieldName;
            }
        }

Relates to https://github.com/dotnet/roslyn/pull/22664#discussion_r149507555

Guida contributor