Static resolution options will not be resolved with respect to extension methods, so this particular approach is not possible.
, , , -.
, , , , , , :
type Ext = Ext
with
static member Bar (ext : Ext, flt : float) = 1.0 + flt
static member Bar (ext : Ext, flt : float32) = 1.0f + flt
, , :
let inline bar (x : ^a) =
((^b or ^a) : (static member Bar : ^b * ^a -> ^a) (Ext, x))
:
bar 7.0f
val it : float32 = 8.0f
bar 5.0
val it : float = 6.0