Why this compiler error when mixing C# ValueTuple and dynamic

Viewed 951

When using ValueTuple and dynamic object, I received this weird CS8133 error. I am passing dynamic object as input and taking ValueTuple as output. Why are they affecting each other.

public static (string, string) foo(dynamic input)
{
    return ("", "");
}

public void foo_test()
{
    dynamic input = new { a = "", b = "" };
    (string v1, string v2) = foo(new { a = "", b = "" }); //compiles fine
    (string v3, string v4) = foo(input); //CS8133 Cannot deconstruct dynamic objects
    var result = foo(input);  //compiles fine
}

Edit: The error message is: CS8133 Cannot deconstruct dynamic objects

1 Answers
Related