Given the following Scala code:
def stream(callback: (String, Array[Byte]) => Unit) { callback("application/json;charset=utf-8", Array(1)) callback("application/xml;charset=utf-8", Array(1)) } @Test def whenStreaming_thenShouldSeeSameMessages() { var actualMessages = List.empty[(String, Array[Byte])] sut.stream { (contentType, payload) => actualMessages += (contentType, payload) } expect(List("application/json;charset=utf-8", "application/xml;charset=utf-8")) { actualMessages } } Why am I getting the following error message:
error: too many arguments for method +: (other: String)java.lang.String actualMessages += (contentType, payload) Specifically, payload is highlighted in IDEA, and on the command line, += is highlighted. I really don't understand that error message.