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

Compiler Crash on Equality Comparison of a Tuple Casted from dynamic #76028

Open
Jason5Lee opened this issue Nov 22, 2024 · 1 comment
Open
Assignees
Milestone

Comments

@Jason5Lee
Copy link

Version Used: .NET 9.0.0

Steps to Reproduce:

  1. Compile the following C# code (SharpLab Link):
    • The code involves casting a dynamic value to a tuple and performing an equality comparison on another tuple.
public class C {
    public static bool Test(dynamic o) =>
        (((int, int))o) == (2, 3);
}

Expected Behavior: The compiler compiles the code without crashes.

Actual Behavior:

  • The compilation process fails in Visual Studio with the error:

    "csc.exe" exited with code -2146232797

  • Additional details, including a stack trace, are available in the linked SharpLab page.
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 22, 2024
@jjonescz
Copy link
Member

System.InvalidOperationException: Unexpected value 'ExplicitDynamic' of type 'Microsoft.CodeAnalysis.CSharp.ConversionKind'
   at Microsoft.CodeAnalysis.CSharp.CodeGen.CodeGenerator.EmitConversion(BoundConversion conversion)

@jaredpar jaredpar removed the untriaged Issues and PRs which have not yet been triaged by a lead label Nov 26, 2024
@jaredpar jaredpar added this to the 17.13 milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants