let t1 = "" :> IEquatable<string>
// Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression.
[<AllowNullLiteral>]
type NullAllowed() =
interface IEquatable<NullAllowed> with member _.Equals(y: NullAllowed) = true
let _ = NullAllowed() :> IEquatable<NullAllowed>
// Nullness warning: The types 'IEquatable<NullStringWrapper>' and 'IEquatable<NullStringWrapper> | null' do not have compatible nullability.
VS 17.14.6
Misc notes:
Equalsas nullable generic mathematics interfaces should use nullable reference types runtime#73855 (comment), a wart which F# seems to squash, allowingIEquatable<'T>to be defined withEquals(y: 'T) = .... But that doesn't seem directly relevant to the above issue."" :> IEquatable<string | null>doesn't give a warning[<Struct>] type StringWrapper(s: string) = member _.Value = s.