fixes the test for SI-7112

resubmission of https://github.com/scala/scala/pull/2159 against `master`