1
我從Kotlin的一個循環繼續,但我從工作室得到警告,標籤不表示循環。有人能告訴我這個語法有什麼問題嗎?該標籤並不代表循環for for each
下面是代碼段
newRooms.forEach [email protected] { wallRoom: WallRoom ->
val index = rooms.indexOf(wallRoom)
if(index!=-1)
{
val room = rooms[index] //get the corresponding room.
//check if the last session is same in the room.
if(wallRoom.topics.last().fetchSessions().last()==room.topics.last().fetchSessions().last())
{
[email protected]
}
爲什麼不能只打印1,它不應該退出,因爲返回@標籤? – AVEbrahimi
@Avebrahimi它僅從lambda返回,但不會破壞for循環。 – BakaWaii