Hey, any idea how to get this code compiling? The ...
# getting-started
j
Hey, any idea how to get this code compiling? The compiler tells me that updatesToSend might be assigned multiple times... But I know that the code in write is only executed once. How can I tell that information to the compiler?
Copy code
val updatesToSend: ImmutableList<String>
      lock.write {
        updatesToSend = ImmutableList.copyOf(updateQueue)
        updateQueue.removeAll { true }
      }