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

◆ ThrowNoInvokeException()

void System.Reflection.RuntimeMethodInfo.ThrowNoInvokeException ( )
inlineprivate

Definition at line 409 of file RuntimeMethodInfo.cs.

410 {
411 if ((InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_CONTAINS_STACK_POINTERS) != 0)
412 {
413 throw new NotSupportedException();
414 }
415 if ((CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs)
416 {
417 throw new NotSupportedException();
418 }
419 if (DeclaringType.ContainsGenericParameters || ContainsGenericParameters)
420 {
421 throw new InvalidOperationException(SR.Arg_UnboundGenParam);
422 }
423 if (base.IsAbstract)
424 {
425 throw new MemberAccessException();
426 }
427 if (ReturnType.IsByRef)
428 {
429 Type elementType = ReturnType.GetElementType();
430 if (elementType.IsByRefLike)
431 {
432 throw new NotSupportedException(SR.NotSupported_ByRefToByRefLikeReturn);
433 }
434 if (elementType == typeof(void))
435 {
436 throw new NotSupportedException(SR.NotSupported_ByRefToVoidReturn);
437 }
438 }
439 throw new TargetException();
440 }

References System.SR.Arg_UnboundGenParam, System.Reflection.RuntimeMethodInfo.ContainsGenericParameters, System.Reflection.RuntimeMethodInfo.DeclaringType, System.elementType, System.Reflection.RuntimeMethodInfo.InvocationFlags, System.SR.NotSupported_ByRefToByRefLikeReturn, System.SR.NotSupported_ByRefToVoidReturn, and System.Reflection.RuntimeMethodInfo.ReturnType.

Referenced by System.Reflection.RuntimeMethodInfo.Invoke(), and System.Reflection.RuntimeMethodInfo.InvokeOneParameter().