As @kvb shows, functions do not support dispersion, so batch conversion is required for interfaces and subclasses.
Here is a small example demonstrating the behavior with subclasses:
type A() = member xA = "A" type B() = inherit A() member xB = "B" let f (g: _ -> A) = g() let a = f (fun () -> A())
If the function f written by you, adding type restrictions can help:
// This works for interface as well let f (g: _ ->
Otherwise, you need to perform litle upcast as described in your example.
source share