def test(): Unit = { for(i <- 1 to 10) { println(i); if(i == 5) return; } println("test"); //実行されたら気持ち悪い }