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

ILight.Power() was typoed as ILight.PowerStatus. #45152

Open
BigSquareHasNoEdge opened this issue Mar 6, 2025 · 1 comment · May be fixed by #45168
Open

ILight.Power() was typoed as ILight.PowerStatus. #45152

BigSquareHasNoEdge opened this issue Mar 6, 2025 · 1 comment · May be fixed by #45168
Labels
advanced-concepts/subsvc dotnet-csharp/svc help wanted Good for community contributors to help [up-for-grabs] in-pr This issue will be closed (fixed) by an active pull request.

Comments

@BigSquareHasNoEdge
Copy link

BigSquareHasNoEdge commented Mar 6, 2025

Type of issue

Typo

Description

In this section, ILight was added Power() with default implementation:

public interface ILight
{
    //...
    public PowerStatus Power() => PowerStatus.NoPower;
}

However, the following sections are indicating it as PowerStatus.

Avoid overriding the same method ... an override of PowerStatus, ....

Both the diagram right below the above paragraph and the next paragraph after the diagram contain the same typo.

The preceding diagram illustrates the ambiguity. OverheadLight doesn't provide an implementation of ILight.PowerStatus. Both IBlinkingLight and ITimerLight provide overrides that are more specific. A call to ILight.PowerStatus on an instance of OverheadLight is ambiguous. You must add a new override in OverheadLight to resolve the ambiguity.

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/interface-implementation/mixins-with-default-interface-methods

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/advanced-topics/interface-implementation/mixins-with-default-interface-methods.md

Document Version Independent Id

98229926-6c7a-3ad1-ab5c-86231253986c

Platform Id

5f097f47-9790-5a92-55f5-70776d1c799f

Article author

@BillWagner

Metadata

  • ID: 2c7899e8-3f01-41d2-137a-e334b73699a4
  • PlatformId: 5f097f47-9790-5a92-55f5-70776d1c799f
  • Service: dotnet-csharp
  • Sub-service: advanced-concepts

Related Issues

@dotnet-policy-service dotnet-policy-service bot added the ⌚ Not Triaged Not triaged label Mar 6, 2025
@BigSquareHasNoEdge BigSquareHasNoEdge changed the title The return type of the interface member was expressed as a member ILight.Power() was typoed as ILight.PowerStatus. Mar 6, 2025
@BillWagner BillWagner added help wanted Good for community contributors to help [up-for-grabs] and removed ⌚ Not Triaged Not triaged labels Mar 7, 2025
@BillWagner
Copy link
Member

Thanks for pointing this out @BigSquareHasNoEdge

I've added it to our backlog, and added the "help wanted" label if anyone wants to submit a PR.

samwherever added a commit to samwherever/dotnet-local-dev that referenced this issue Mar 7, 2025
@adegeo adegeo linked a pull request Mar 7, 2025 that will close this issue
@dotnet-policy-service dotnet-policy-service bot added the in-pr This issue will be closed (fixed) by an active pull request. label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced-concepts/subsvc dotnet-csharp/svc help wanted Good for community contributors to help [up-for-grabs] in-pr This issue will be closed (fixed) by an active pull request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants