Work in progress to add support for covariant return types to the .NET runtime. Soon we'll be able to override a virtual method returning `object` with a method returning `string`. Because of how array variance works, weird things might be possible in IL.
class Base { public virtual IntPtr[] Fun() => null; } // This is obvious pseude-code because C# won't let us introduce methods differing // in return type. C# also requires to be explicit about "virtual" and "override". // But IL... not so much. class Derived : Base { // overrides Base.Fun on 32bit platforms. public override uint[] Fun() => null; // overrides Base.Fun on 64bit platforms. public override ulong[] Fun() => null; }
- Fadeout unused variable names (#1324, PR: #3733)
- Updated debugger (PR: #3729)
- Fixed not supported exception when trying to decompile a BCL assembly on Mono. For now we do not try to resolve implementation assembly from a ref assembly (PR: omnisharp-roslyn/#1767)
- Added support for generic classes in test runner (#3722, PR: omnisharp-roslyn/#1768)
- Improved autocompletion performance (PR: omnisharp-roslyn/#1761)
- Move to Roslyn's .editorconfig support (omnisharp-roslyn/#1657, PR: omnisharp-roslyn/#1771)
- Fully update CompilationOptions when project files change (PR: omnisharp-roslyn/#1774)
MockHttp is a testing layer for Microsoft's HttpClient library. It allows stubbed responses to be configured for matched HTTP requests and can be used to test your application's service layer.
var mockHttp = new MockHttpMessageHandler(); // Setup a respond for the user api (including a wildcard in the URL) mockHttp.When("http://localhost/api/user/*") .Respond("application/json", "{'name' : 'Test McGee'}"); // Respond with JSON // Inject the handler or client into your application code var client = mockHttp.ToHttpClient(); var response = await client.GetAsync("http://localhost/api/user/1234"); // or without async: var response = client.GetAsync("http://localhost/api/user/1234").Result; var json = await response.Content.ReadAsStringAsync(); // No network connection required Console.Write(json); // {'name' : 'Test McGee'}