Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE0040: Accessibility modifiers required should not be reported on file types #62259

Closed
RikkiGibson opened this issue Jun 29, 2022 · 1 comment
Assignees
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Milestone

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Jun 29, 2022

Related to #60819

File types cannot specify accessibility modifiers, so the IDE shouldn't suggest doing so.

Actual behavior:

file class FC // info IDE0040: Accessibility modifiers required
{
}

Expected behavior:

file class FC // no diagnostic
{
}
@RikkiGibson RikkiGibson self-assigned this Jun 29, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jun 29, 2022
@RikkiGibson RikkiGibson added this to the 17.4 milestone Jun 29, 2022
@Youssef1313
Copy link
Member

case SyntaxKind.ClassDeclaration:
case SyntaxKind.RecordDeclaration:
case SyntaxKind.StructDeclaration:
case SyntaxKind.RecordStructDeclaration:
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.DelegateDeclaration:
case SyntaxKind.FieldDeclaration:
case SyntaxKind.EventFieldDeclaration:
case SyntaxKind.GetAccessorDeclaration:
case SyntaxKind.SetAccessorDeclaration:
case SyntaxKind.InitAccessorDeclaration:
case SyntaxKind.AddAccessorDeclaration:
case SyntaxKind.RemoveAccessorDeclaration:
return true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants