Calling a Dictionary
's Add()
method using named arguments works in F#.
let d = Dictionary<string, obj>()
d.Add(key = "five", value = 5)
let d2= Dictionary<obj, obj>()
d2.Add(key = "five", value = 5)
d2.Add(key = 5, value = 5)
In Polly's Context
class , there is a similar Add()
method with 2 overloads:
Add(key: obj, value: obj) : unit
Add(key: string, value: obj) : unit
And I can use it in all of these ways:
let c = Polly.Context()
c.Add("five", 5)
c.Add(5, 5)
c.Add(key = 5, value = 5)
But not this way, it says it can't resolve between the overloads and needs a type annotation.
c.Add(key = "five", value = 5)
Why is that and how can I fix it?