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

Don't recommend readonly after readonly #72394

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

ghost
Copy link

@ghost ghost commented Mar 5, 2024

Closes #72372

This pr does 2 changes to address the issue:

  • disallow the readonly modifier to appear in the declaration
  • disallow partial

On the second point, this is because while it is possible to have both readonly and partial, it is not possible to have readonly appear AFTER partial while being syntactically valid. This means that effectively, if we already have partial, readonly shouldn't be recommended.

While investigating, I found that existing tests seemed to have enforced the opposite. Particularly, it seemed there was a test that was testing that readonly was recommended right after it. I changed those tests too.

@ghost ghost self-requested a review as a code owner March 5, 2024 16:05
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 5, 2024
@CyrusNajmabadi
Copy link
Member

Thanks!

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge March 5, 2024 16:23
@ghost
Copy link
Author

ghost commented Mar 5, 2024

@CyrusNajmabadi seems a CI test broke and another might be stalling, but they don't look normal.

@CyrusNajmabadi CyrusNajmabadi merged commit f36b2cc into dotnet:main Mar 5, 2024
27 checks passed
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

Successfully merging this pull request may close these issues.

IntelliSense suggests the readonly modifier even when it's already present in the incomplete declaration
2 participants