backports https://github.com/scala/scala/pull/3657
fixup for tests broken in master