dotnet/roslyn

SourceFieldSymbol.HasRuntimeSpecialName should check that containing type is enum

Open

#23,058 opened on Nov 7, 2017

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C# (4,257 forks)batch import
Area-CompilersBughelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

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

Contributor guide