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

DataFlow analysis requires both named and underlying ItemX fields be assigned #13046

Closed
VSadov opened this issue Aug 9, 2016 · 2 comments
Closed
Assignees
Labels
Area-Compilers Bug Language-C# Language-VB New Language Feature - Tuples Tuples Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented

Comments

@VSadov
Copy link
Member

VSadov commented Aug 9, 2016

The following should not be an error.

        static void Main(string[] args)
        {
            (string A, string B) ss;

            ss.A = "q";
            ss.Item2 = "w";

            System.Console.WriteLine(ss);
        }

Severity Code Description Project File Line Suppression State
Error CS0165 Use of unassigned local variable 'ss' Program.cs 18 Active

@VSadov
Copy link
Member Author

VSadov commented Aug 9, 2016

Note that the bug exists in both C# and VB for the same reasons and the fix should be implemented for both languages.

One of possible results of bad def assignment analysis could be wrong async captures (since that relies on unassignendness at suspend points).
When fixing, Check that all is ok when tuple locals are captured.

@jcouv
Copy link
Member

jcouv commented Aug 19, 2016

Fixed by #13107

@jcouv jcouv closed this as completed Aug 19, 2016
@jcouv jcouv added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Language-C# Language-VB New Language Feature - Tuples Tuples Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

2 participants