You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varcode=""" using Rocks; [assembly: Rock(typeof(IServiceDerived), BuildType.Create | BuildType.Make)] public interface IOutBase { } public interface IOutDerived : IOutBase { } public interface IServiceBase { void TryGet<T>(out T value) where T : IOutBase; } public interface IServiceDerived : IServiceBase { new void TryGet<T>(out T value) where T : IOutDerived; } """;
Expected behavior
Mock code is generated with errors.
Actual behavior
The following error occurs:
// Rocks\Rocks.RockGenerator\IServiceDerived_Rock_Create.g.cs(49,15): error CS0425:
The constraints for type parameter 'T' of method 'IServiceDerivedCreateExpectations.Mock.TryGet<T>(out T)' must match the constraints for type parameter 'T' of interface method 'IServiceBase.TryGet<T>(out T)'. Consider using an explicit interface implementation instead.
Additional context
This can be fixed if the base type is generated explicitly:
To Reproduce
Expected behavior
Mock code is generated with errors.
Actual behavior
The following error occurs:
Additional context
This can be fixed if the base type is generated explicitly:
This was found by trying to duplicate this issue in NSubstitute.
The text was updated successfully, but these errors were encountered: