Code eval swap case problem in scala