import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
  def future1: Future[Unit] = Future.successful(())
  def future2: Future[Unit] = Future.successful(())
  def test: Future[Unit] = future1.map { _ => future2 } 
the body of the test function returns Future[Future[Unit]], however, the compiler is happy to say that it is simply a Future[Unit], which leads to errors in code