function declaration moved in guard block

wtf?