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

No diagnostic about static member in object expression #16277

Conversation

edgarfgp
Copy link
Contributor

@edgarfgp edgarfgp commented Nov 14, 2023

Follow-up: #16250.

  • Object expressions should skip checking for non-instance members.
  • Implementing static members which will be unusable at the instance level.

@edgarfgp edgarfgp closed this Nov 15, 2023
@edgarfgp edgarfgp reopened this Nov 15, 2023
@edgarfgp edgarfgp marked this pull request as ready for review November 16, 2023 12:39
@edgarfgp edgarfgp requested a review from a team as a code owner November 16, 2023 12:39
@edgarfgp
Copy link
Contributor Author

This is ready

Co-authored-by: Adam Boniecki <20281641+abonie@users.noreply.github.com>
Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So looks like IWSAMs are fine? Thanks for the extra testing :)

@edgarfgp
Copy link
Contributor Author

So looks like IWSAMs are fine? Thanks for the extra testing :)

Yes and added more tests in my last commit.

@edgarfgp edgarfgp force-pushed the not-diagnostic-about-static-member-in-object-expression branch from 6f105d5 to 423d8d4 Compare November 20, 2023 21:53
@edgarfgp
Copy link
Contributor Author

As discussed with @vzarytovskii This PR:

  • Avoid checking for static members in object expressions. As this can NOT be used on an instance
  • Reuses error 3860 with an updated message to prevent runtime errors when an object expression attempts to implement an interfaces with static abstract members.

@vzarytovskii vzarytovskii merged commit d41a0d7 into dotnet:main Nov 21, 2023
25 checks passed
@vzarytovskii
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants