I have installed .NET 6 Preview 7 successfully. I have access to System.IAdditionOperators<,,>
. My problem is that when I try to implement the interface it doesn't require me to define the +
operator.
My project file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<LangVersion>preview</LangVersion>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.Experimental" Version="6.0.0-preview.7.21377.19" />
</ItemGroup>
</Project>
My one and only class:
using System;
namespace TestCode
{
public class Foo:IAdditionOperators<Foo,Foo,Foo>
{
}
}
The code compiles (which it shouldn't!) even though I haven't implemented IAdditionOperators<Foo,Foo,Foo>
. How do I make it force me to implement the +
operator?
I have already downloaded the SDK, and updated Visual Studio to version 16.11.4. I have already checked the box for "Use preview of the .NET SDK" and restarted Visual Studio. What else do I have to do?