Unfortunately, the code does not compile with the SAM-converted function. I 
have not yet understood the reason. The compiler error is:
```
method transform in interface KStream<K,V> cannot be applied to given types;
                    .transform(() ->  new Transformer<Windowed<String>, Long, 
KeyValue<Object, Object>>() {
                    ^
  required: TransformerSupplier<? super Windowed<String>,? super Long,? extends 
KeyValue<? extends K1,? extends V1>>,String[]
  found: ()->new Tr[...]{ } }
  reason: cannot infer type-variable(s) K1,V1
    (argument mismatch; bad return type in lambda expression
      <anonymous Transformer<Windowed<String>,Long,KeyValue<Object,Object>>> 
cannot be converted to Transformer<Windowed<String>,Long,KeyValue<? extends 
K1,? extends V1>>)
  where K1,V1,K,V are type-variables:
    K1 extends Object declared in method <K1,V1>transform(TransformerSupplier<? 
super K,? super V,? extends KeyValue<? extends K1,? extends V1>>,String...)
    V1 extends Object declared in method <K1,V1>transform(TransformerSupplier<? 
super K,? super V,? extends KeyValue<? extends K1,? extends V1>>,String...)
    K extends Object declared in interface KStream
    V extends Object declared in interface KStream
```
When I use the old generics signature for `transform` it compiles. I will take 
a deeper look at it. 

[ Full content available at: https://github.com/apache/kafka/pull/5273 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to