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

Four errors instead of one for erroneous deconstruct #25533

Open
gafter opened this issue Mar 16, 2018 · 0 comments
Open

Four errors instead of one for erroneous deconstruct #25533

gafter opened this issue Mar 16, 2018 · 0 comments
Labels
Area-Compilers Bug Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings.
Milestone

Comments

@gafter
Copy link
Member

gafter commented Mar 16, 2018

The following code

    public static void M(object o)
    {
        var (x, y) = o;
    }

Gets four errors when only one is deserved

error CS1061: 'object' does not contain a definition for 'Deconstruct' and no extension method 'Deconstruct' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
error CS8129: No suitable Deconstruct instance or extension method was found for type 'object', with 2 out parameters and a void return type.
error CS8130: Cannot infer the type of implicitly-typed deconstruction variable 'x'.
error CS8130: Cannot infer the type of implicitly-typed deconstruction variable 'y'.
@gafter gafter added Bug Area-Compilers Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. labels Mar 16, 2018
@gafter gafter added this to the 16.0 milestone Jul 25, 2018
@jinujoseph jinujoseph modified the milestones: 16.0, 16.3 Jun 9, 2019
@jcouv jcouv modified the milestones: 16.3, Compiler.Next Jul 8, 2019
@jaredpar jaredpar modified the milestones: Compiler.Next, Backlog Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings.
Projects
None yet
Development

No branches or pull requests

4 participants