bug: wrong switch statement tag scope