Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert failure: Unexpected value 'LessDerived' of type 'Microsoft.CodeAnalysis.CSharp.MemberResolutionKind' #52701

Closed
cston opened this issue Apr 17, 2021 · 0 comments · Fixed by #55899
Assignees
Milestone

Comments

@cston
Copy link
Member

cston commented Apr 17, 2021

Compile the following with a DEBUG build of 16.10:

class A
{
    internal void F<T>(T t) where T : class { }
}
class B : A
{
    internal new void F<T>(T t) where T : struct { }
    void M()
    {
        System.Action<object> d = F<object>;
    }
    static void Main()
    {
        new B().M();
    }
}

Result:
Roslyn.Utilities.ExceptionUtilities.UnexpectedValue Line 20 C#
Microsoft.CodeAnalysis.CSharp.OverloadResolutionResult<Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol>.AssertNone Line 1458 C#
Microsoft.CodeAnalysis.CSharp.OverloadResolutionResult<Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol>.ReportDiagnostics<Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol> Line 257 C#
Microsoft.CodeAnalysis.CSharp.Conversions.ReportDelegateOrFunctionPointerMethodGroupDiagnostics Line 201 C#
Microsoft.CodeAnalysis.CSharp.Binder.GenerateImplicitConversionError.__reportMethodGroupErrors|881_0 Line 2227 C#
Microsoft.CodeAnalysis.CSharp.Binder.GenerateImplicitConversionError Line 2144 C#
Microsoft.CodeAnalysis.CSharp.Binder.GenerateConversionForAssignment Line 1803 C#

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 17, 2021
@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 20, 2021
@jaredpar jaredpar added this to the C# 10 milestone Apr 20, 2021
@jaredpar jaredpar modified the milestones: C# 10, 17.0 Jul 13, 2021
@jaredpar jaredpar assigned AlekseyTs and unassigned cston Aug 25, 2021
AlekseyTs added a commit to AlekseyTs/roslyn that referenced this issue Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants