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

◆ CatchType

override Type System.Reflection.RuntimeExceptionHandlingClause.CatchType
get

Definition at line 46 of file RuntimeExceptionHandlingClause.cs.

47 {
48 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "Module.ResolveType is marked as RequiresUnreferencedCode because it relies on tokenswhich are not guaranteed to be stable across trimming. So if somebody hardcodes a token it could break.The usage here is not like that as all these tokens come from existing metadata loaded from some ILand so trimming has no effect (the tokens are read AFTER trimming occured).")]
49 get
50 {
51 if (_flags != 0)
52 {
53 throw new InvalidOperationException(SR.Arg_EHClauseNotClause);
54 }
55 Type result = null;
56 if (!MetadataToken.IsNullToken(_catchMetadataToken))
57 {
59 Module module = ((declaringType == null) ? _methodBody._methodBase.Module : declaringType.Module);
60 result = module.ResolveType(_catchMetadataToken, declaringType?.GetGenericArguments(), (_methodBody._methodBase is MethodInfo) ? _methodBody._methodBase.GetGenericArguments() : null);
61 }
62 return result;
63 }
64 }
virtual Type[] GetGenericArguments()

Referenced by System.Reflection.RuntimeExceptionHandlingClause.ToString().