To reproduce:
public class BaseStuff
{
public virtual T? GetService<T>(object[] args) where T : class => default!;
}
public static class Test
{
public static void Go() => Rock.Create<BaseStuff>();
}
This will give the following error:
CS8822: Method 'CreateExpectationsOfBaseStuffExtensions.RockBaseStuff.GetService<T>(object[])' specifies a 'default' constraint for type parameter 'T', but corresponding type parameter 'T' of overridden or explicitly implemented method 'BaseStuff.GetService<T>(object[])' is constrained to a reference type or a value type.
This was found on System.Reactive.PlatformServices.CurrentPlatformEnlightenmentProvider.
To reproduce:
This will give the following error:
This was found on
System.Reactive.PlatformServices.CurrentPlatformEnlightenmentProvider.