GNOME Bugzilla – Bug 570128
Warning for variable which was assigned but not used
Last modified: 2018-05-22 13:17:00 UTC
Please describe the problem: In the attached testcase, valac trunk feb 1st warns me about assigning but not using a local variable at line 81, but no such warnings are given for line 70 and 74. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 127717 [details] testcase (compare lines 70, 74 and 81 in main.vala )
About element1, it is initialized by the out argument at line 71 About element2, vala could warn about assigned but not used yes. void main () { string foo; foo = "foo"; }
Created attachment 188979 [details] [review] Do not mark variable as used for simple assignments Fixes bug 570128. Things get more complicated for non-simple assignments because they get transformed.
Minor improvements tagged for 1.2 milestone.
*** Bug 664084 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/24.