Skip to content

Commit a991afd

Browse files
committed
C#: Use ref conversions (including variance conversions) for element types of span conversions.
1 parent b686890 commit a991afd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

csharp/ql/lib/semmle/code/csharp/Conversion.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,7 @@ predicate convSpan(Type fromType, Type toType) {
533533
) and
534534
toElementType = toType.(ReadOnlySpanType).getElementType()
535535
|
536-
convIdentity(fromElementType, toElementType)
537-
or
538-
convVariance(fromElementType, toElementType)
536+
convRefTypeNonNull(fromElementType, toElementType)
539537
)
540538
or
541539
fromType instanceof SystemStringClass and

0 commit comments

Comments
 (0)