What
The standard FS3261 warning for e.g.
let x : string | null = null
x.Length // unsafe access - FS3261
is as follows:
warning FS3261: Nullness warning: The types 'string' and 'string | null' do not have compatible nullability.
Why
This error is not especially friendly or easy to understand, nor does it give a solution to fix the issue.
How
Consider replacing with:
warning FS3261: The symbol `x` may be null, and accessing the `Length` member could lead to a runtime exception. Consider pattern matching and / or converting to an Option using 'Option.ofObj' to safely access the value.