Hey,
I played a bit around with Motoko generics and discovered a problem in following code. Is it expected behaviour or a bug?
testFn() says:
cannot implicitly instantiate function of type
<R1, R2, E1, E2>(Result/1<R1, E1>, R1 -> Result/1<R2, E2>) ->
Result/1<R2, Error2/1<E1, E2>>
to argument of type
(Result/1<Nat, Text>, Nat -> Result/1<Text, Nat>)
to produce result of type
()
because no instantiation of R1/2, R2/2, E1/3, E2/3 makes
(Result/1<Nat, Text>, Nat -> Result/1<Text, Nat>) <:
(Result/1<R1/2, E1/3>, R1/2 -> Result/1<R2/2, E2/3>)
and
Result/1<R2/2, Error2/1<E1/3, E2/3>> <: ()
See Motoko Playground - DFINITY
Thanks