diff --git a/csharp/ql/lib/semmle/code/csharp/Conversion.qll b/csharp/ql/lib/semmle/code/csharp/Conversion.qll index e9222c469a7..ec7ef9cac95 100644 --- a/csharp/ql/lib/semmle/code/csharp/Conversion.qll +++ b/csharp/ql/lib/semmle/code/csharp/Conversion.qll @@ -533,9 +533,7 @@ predicate convSpan(Type fromType, Type toType) { ) and toElementType = toType.(ReadOnlySpanType).getElementType() | - convIdentity(fromElementType, toElementType) - or - convVariance(fromElementType, toElementType) + convRefTypeNonNull(fromElementType, toElementType) ) or fromType instanceof SystemStringClass and