Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ChkCastAny()

static unsafe object System.Runtime.CompilerServices.CastHelpers.ChkCastAny ( void * toTypeHnd,
object obj )
inlinestaticprivate

Definition at line 265 of file CastHelpers.cs.

266 {
267 if (obj != null)
268 {
269 void* methodTable = RuntimeHelpers.GetMethodTable(obj);
270 if (methodTable != toTypeHnd)
271 {
272 CastResult castResult = TryGet((nuint)methodTable, (nuint)toTypeHnd);
273 if (castResult != CastResult.CanCast)
274 {
275 return ChkCastAny_NoCacheLookup(toTypeHnd, obj);
276 }
277 }
278 }
279 return obj;
280 }
static unsafe object ChkCastAny_NoCacheLookup(void *toTypeHnd, object obj)
static CastResult TryGet(nuint source, nuint target)

References System.Runtime.CompilerServices.CastHelpers.ChkCastAny_NoCacheLookup(), System.Runtime.CompilerServices.RuntimeHelpers.GetMethodTable(), System.obj, and System.Runtime.CompilerServices.CastHelpers.TryGet().