You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is the following: x is declared and marked as used by the float32 case, but it's not used by the default case. A possible solution could be declaring x outside the float32 case, but this is not possibile: x has as different type according to the case where it's used, so must have a different declaration for every case of the switch.
The text was updated successfully, but these errors were encountered:
zapateo
changed the title
compiler: false positive "declared and not used"
compiler: switch statements report false positive "declared and not used" errors
Aug 1, 2019
The commit c2b582d marks every identifier declared in a type switch statement as used, so this error is not reported any more.
Now the error is not reported even if the variable is never used: see #474 for more informations.
returns error:
main:5:9: x declared and not used
The reason is the following:
x
is declared and marked as used by thefloat32
case, but it's not used by thedefault
case. A possible solution could be declaringx
outside thefloat32
case, but this is not possibile:x
has as different type according to the case where it's used, so must have a different declaration for every case of the switch.The text was updated successfully, but these errors were encountered: