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

Edit pass for C# 8 speclets #9042

Merged
merged 4 commits into from
Jan 13, 2025
Merged

Conversation

BillWagner
Copy link
Member

Closes #8098

Notes on this PR for reviewers:

  1. I only edited the speclets that haven't been incorporated into the current draft V8 specification. (Thankfully, that means I didn't edit the NRT spec in this folder).
  2. I did try to mark areas in the default interface members specification that weren't implemented in C# 8. I intended to mark all those as "not implemented in C# 8" because some involved early questions on static virtual (or abstract) methods or operators. I think it got most of these correct. However, that's the one area that could use the most careful review.

In particular, none of the examples that specify which base interface method to invoke from an override compiled. I believe that wasn't implemented, even though it was specified with decisions to implement a given syntax.

Closes dotnet#8098

Notes on this PR for reviewers:

1. I only edited the speclets that haven't been incorporated into the current draft V8 specification. (Thankfully, that means I didn't edit the NRT spec in this folder).
1. I did try to mark areas in the default interface members specification that weren't implemented in C# 8. I intended to mark all those as "not implemented in **C# 8**" because some involved early questions on static virtual (or abstract) methods or operators. I think it got most of these correct. However, that's the one area that could use the most careful review.

In particular, none of the examples that specify *which* base interface method to invoke from an override compiled. I believe that wasn't implemented, even though it was specified with decisions to implement a given syntax.
@BillWagner BillWagner requested a review from a team as a code owner January 10, 2025 22:40
@BillWagner
Copy link
Member Author

/cc @333fred @jcouv

Copy link
Member

Choose a reason for hiding this comment

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

@AlekseyTs would you be able to give the edits here a review?

Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

Generally LGTM, but I'd like someone with better understanding of DIM to look at that one.

proposals/csharp-8.0/default-interface-methods.md Outdated Show resolved Hide resolved
@@ -211,10 +207,14 @@ Because interfaces may now contain executable code, it is useful to abstract com

> ***Open issue***: should we permit interface methods to be `protected` or `internal` or other access? If so, what are the semantics? Are they `virtual` by default? If so, is there a way to make them non-virtual?

> ***Open issue***: If we support static methods, should we support (static) operators?
> ***Open issue***: If we support static methods, should we support (static) operators? **Decision: NO**
Copy link
Contributor

@AlekseyTs AlekseyTs Jan 10, 2025

Choose a reason for hiding this comment

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

This feels inaccurate. I think we supported operators too. #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

I made the same mistake here, by not implementing the operator. So, the compiler interpreted it as a bad declaration for a static virtual member, which isn't supported in C# 8.

@@ -741,12 +748,18 @@ but `C` is not recompiled. What happens when the program is run? An invocation o

### Permit `partial` in interface? (closed)

This was not implemented in C# 8.
Copy link
Contributor

@AlekseyTs AlekseyTs Jan 10, 2025

Choose a reason for hiding this comment

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

I am not sure about this. I see a lot of DIM tests using partial interfaces. If partial interfaces were not supported prior to DIM support, it looks like they become available at the same time. #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @AlekseyTs

I see what I had done wrong: I created an interface that declared partial methods with arguments and different return types. Those weren't supported in C# 8.

Fixed.

@AlekseyTs
Copy link
Contributor

Done with review of default-interface-methods.md (commit 1)

@BillWagner
Copy link
Member Author

Thanks @AlekseyTs

Updates from today address all your comments.

@AlekseyTs
Copy link
Contributor

Changes in default-interface-methods.md LGTM (commit 4)

@BillWagner BillWagner merged commit 5575b06 into dotnet:main Jan 13, 2025
1 check passed
@BillWagner BillWagner deleted the csharp8-speclet-review branch January 13, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal]: Edit speclets to distinguish features already delivered from potential future enhancements
3 participants