Skip to content

Commit bd03885

Browse files
authored
remove virtual from interface declarations (#1639)
It's not needed, and it's likely to lead to reader confusion.
1 parent df710df commit bd03885

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

csharp/tutorials/mixins-with-interfaces/IBlinkingLight.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace mixins_with_interfaces
88
// <SnippetBlinkingLight>
99
public interface IBlinkingLight : ILight
1010
{
11-
public virtual async Task Blink(int duration, int repeatCount)
11+
public async Task Blink(int duration, int repeatCount)
1212
{
1313
Console.WriteLine("Using the default interface method for IBlinkingLight.Blink.");
1414
for (int count = 0; count < repeatCount; count++)

csharp/tutorials/mixins-with-interfaces/ILight.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public interface ILight
2222
void SwitchOn();
2323
void SwitchOff();
2424
bool IsOn();
25-
public virtual PowerStatus Power() => PowerStatus.NoPower;
25+
public PowerStatus Power() => PowerStatus.NoPower;
2626
}
2727
// </SnippetILightInterface>
2828
}

csharp/tutorials/mixins-with-interfaces/ITimerLight.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace mixins_with_interfaces
88
// <SnippetTimerLightFinal>
99
public interface ITimerLight : ILight
1010
{
11-
public virtual async Task TurnOnFor(int duration)
11+
public async Task TurnOnFor(int duration)
1212
{
1313
Console.WriteLine("Using the default interface method for the ITimerLight.TurnOnFor.");
1414
SwitchOn();

csharp/tutorials/mixins-with-interfaces/mixins-with-interfaces.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp3.0</TargetFramework>
6-
<RootNamespace>virtual_interface_methods</RootNamespace>
6+
<RootNamespace>mixins_with_interfaces</RootNamespace>
77
</PropertyGroup>
88

99
</Project>

0 commit comments

Comments
 (0)