C#: Do not consider ref struct as being convertible to object, dynamic and valuetype.

This commit is contained in:
Michael Nebel
2025-01-03 14:05:18 +01:00
parent 9a2edc3d5c
commit ef9f09ebfc

View File

@@ -649,11 +649,14 @@ predicate convBoxing(Type fromType, Type toType) {
}
private predicate convBoxingValueType(ValueType fromType, Type toType) {
toType instanceof ObjectType
or
toType instanceof DynamicType
or
toType instanceof SystemValueTypeClass
(
toType instanceof ObjectType
or
toType instanceof DynamicType
or
toType instanceof SystemValueTypeClass
) and
not fromType.(Struct).isRef()
or
toType = fromType.getABaseInterface+()
}