Please incorporate feedback from previous PR https://github.com/scala/scala/pull/2509