I’m getting a type mismatch error that I’ve been staring at for a few hours. Sorry for the noise, but I’m wondering if someone can help. Here’s my error:
[error] /Users/huntc/Projects/hacking/alpakka/mqtt-streaming/src/main/scala/akka/stream/alpakka/mqtt/streaming/scaladsl/Mqtt.scala:40:30: type mismatch;
[error] found : akka.stream.scaladsl.Flow[akka.util.ByteString,scala.util.Either[akka.stream.alpakka.mqtt.streaming.MqttCodec.DecodeError,akka.stream.alpakka.mqtt.streaming.Event[_ <: A]],akka.NotUsed]
[error] required: akka.stream.Graph[akka.stream.FlowShape[akka.util.ByteString,Either[akka.stream.alpakka.mqtt.streaming.MqttCodec.DecodeError,akka.stream.alpakka.mqtt.streaming.Event[A]]],?]
[error] session.eventFlow.merge(
I think it is because I’m using a Source.empty in my code, and A becomes Nothing. Here’s my code in full:
Given that I’m using a Source.empty, I actually don’t care about the A becoming Nothing. I’m thinking that there might be a place for the use of uncheckedVariance annotation, but I’ve not yet discovered it.
I don’t know enough Akka Streams offhand to answer with confidence, so this is purely a guess. But the error message suggests to me that you’re short a level. Consider – what it wants is:
No, I think that bit is ok. I don’t fully understand either, but I think akka.stream.Graph[akka.stream.FlowShape and akka.stream.scaladsl.Flow translate to the same thing.