panic if func takes unexpected branch