The new FS3559 triggers where I think it should not. Consider this:
let foo (x: obj) = ()
foo null
It triggers on null:
A type has been implicitly inferred as 'obj', which may be unintended. Consider adding explicit type annotations. You can disable this warning by using '#nowarn "3559"' or '--nowarn:3559'.
But the type of the argument is explicitly obj, so it doesn't make sense that it should trigger here.
Another slightly more realistic example:
let invokeStatic (mi: System.Reflection.MethodInfo) =
mi.Invoke(null, [||])
MethodInfo.Invoke expects obj as its first argument, so F# inferring obj here should not cause a warning.
The new FS3559 triggers where I think it should not. Consider this:
It triggers on
null:But the type of the argument is explicitly
obj, so it doesn't make sense that it should trigger here.Another slightly more realistic example:
MethodInfo.Invokeexpectsobjas its first argument, so F# inferringobjhere should not cause a warning.