src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\TypeCast.cs (33)
70MethodTable* mt = obj.GetMethodTable();
105MethodTable* mt = obj.GetMethodTable();
192if (obj == null || obj.GetMethodTable() == pTargetType)
195if (!obj.GetMethodTable()->IsCanonical)
198Debug.Assert(obj.GetMethodTable()->IsArray);
208MethodTable* mt = obj.GetMethodTable()->NonArrayBaseType;
255MethodTable* pObjType = obj.GetMethodTable();
284MethodTable* mt = obj.GetMethodTable();
314MethodTable* mt = obj.GetMethodTable();
379if (obj.GetMethodTable()->IsIDynamicInterfaceCastable
397if (obj == null || obj.GetMethodTable() == pTargetType)
414MethodTable* mt = obj.GetMethodTable();
720Debug.Assert(array.GetMethodTable()->IsArray, "first argument must be an array");
722MethodTable* arrayElemType = array.GetMethodTable()->RelatedParameterType;
723if (AreTypesAssignableInternal(obj.GetMethodTable(), arrayElemType, AssignmentVariation.BoxedSource, null))
728if (obj.GetMethodTable()->IsIDynamicInterfaceCastable && IsInstanceOfInterfaceViaIDynamicInterfaceCastable(arrayElemType, obj, throwing: false))
734throw array.GetMethodTable()->GetClasslibException(ExceptionIDs.ArrayTypeMismatch);
741throw array.GetMethodTable()->GetClasslibException(ExceptionIDs.IndexOutOfRange);
748throw array.GetMethodTable()->GetClasslibException(ExceptionIDs.ArrayTypeMismatch);
756Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array");
777MethodTable* arrayElemType = array.GetMethodTable()->RelatedParameterType;
788Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array");
797MethodTable* elementType = array.GetMethodTable()->RelatedParameterType;
802if (elementType != obj.GetMethodTable())
816if (array.GetMethodTable() == MethodTable.Of<object[]>())
826CastResult result = s_castCache.TryGet((nuint)obj.GetMethodTable() + (int)AssignmentVariation.BoxedSource, (nuint)elementType);
851MethodTable* pObjType = obj.GetMethodTable();
904if (!AreTypesAssignableInternal(obj.GetMethodTable(), pTargetType, AssignmentVariation.BoxedSource, null)
905&& (!obj.GetMethodTable()->IsIDynamicInterfaceCastable
916if (!AreTypesAssignableInternal(obj.GetMethodTable(), pTargetType, AssignmentVariation.BoxedSource, null)
917&& (!obj.GetMethodTable()->IsIDynamicInterfaceCastable
1209MethodTable* pSourceType = obj.GetMethodTable();
1248MethodTable* pSourceType = obj.GetMethodTable();