ScalaPsiUtil.needParentheses() method rewritten
(cherry picked from commit 5070d15)