Recursive composition of a contravariant type

2 replies

Mon, 2008-12-22, 19:30

Sebastien Bocq

Joined: 2008-12-18,

Hello,

I would like to connect an output channel to another output channel to implement a form of indirection, for example to pass on messages from an Output[String] to an Output[Any]. I modeled my problem using the code snipped below. Since output channels are contravariant the compiler doesn't like my `connect` method.

I would like to connect an output channel to another output channel to implement a form of indirection, for example to pass on messages from an Output[String] to an Output[Any]. I modeled my problem using the code snipped below. Since output channels are contravariant the compiler doesn't like my `connect` method.