C# compiler should issue CS1961 for variance violations for local functions within default interface methods #39731
Labels
Area-Compilers
Bug
Feature - Default Interface Impl
Default Interface Implementation
Resolution-Fixed
The bug has been fixed and/or the requested behavior has been implemented
Milestone
Version Used:
Visual Studio 16.3.8
.Net Core 3.0
csc 3.3.1-beta3-19461-02
Steps to Reproduce:
Example repro (either interface will do)
Expected Behavior:
A local function which uses a variant generic type parameter incorrectly should cause a CS1961 'invalid variance' error if the local function is contained within a default interface method.
Actual Behavior:
The program will compile successfully, but throw at runtime when loading the containing type:
The text was updated successfully, but these errors were encountered: