fix a bug in join related to https://issues.scala-lang.org/browse/SI-8985