Any type can be adapted to Unitin the right context, simply reducing the value. In this case, the expression is parsed as follows:
val x: Try[Unit] = Try {
Try {}
()
}
You can warn about problems with the scala compiler for such cases by passing -Ywarn-value-discard.