krasserm / streamz

A combinator library for integrating Functional Streams for Scala (FS2), Akka Streams and Apache Camel
Apache License 2.0
282 stars 44 forks source link

Fix #79 - prevent Flow->Pipe from discarding Mat value #81

Closed Daenyth closed 4 years ago

Daenyth commented 4 years ago

(and likely prevent runtime ClassCastException also)

cc @milanvdm

milanvdm commented 4 years ago

So in Scala if an implicit argument is missing, it will still compile and run? In my head I have that this would already fail and therefore Im a bit confused with this PR 🙂

Daenyth commented 4 years ago

@milanvdm No, it would fail - and that's the point, I want it to fail. It's supposed to, and it didn't fail before

This adds a constraint that the M (mat value type) of the Flow that the dsl method wants to act on, must be statically proven to be NotUsed, or the code won't compile. If you look at the added test, that test would fail without the ev implicit change.