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

◆ IsCompatible() [2/2]

static bool System.Linq.Expressions.Expression< TDelegate >.IsCompatible ( PropertyInfo pi,
Expression< TDelegate >[] args )
inlinestaticprivateinherited

Definition at line 2888 of file Expression.cs.

2889 {
2890 MethodInfo getMethod = pi.GetGetMethod(nonPublic: true);
2892 if (getMethod != null)
2893 {
2894 array = getMethod.GetParametersCached();
2895 }
2896 else
2897 {
2898 getMethod = pi.GetSetMethod(nonPublic: true);
2899 if (getMethod == null)
2900 {
2901 return false;
2902 }
2903 array = getMethod.GetParametersCached();
2904 if (array.Length == 0)
2905 {
2906 return false;
2907 }
2908 array = array.RemoveLast();
2909 }
2910 if (args == null)
2911 {
2912 return array.Length == 0;
2913 }
2914 if (array.Length != args.Length)
2915 {
2916 return false;
2917 }
2918 for (int i = 0; i < args.Length; i++)
2919 {
2920 if (args[i] == null)
2921 {
2922 return false;
2923 }
2924 if (!TypeUtils.AreReferenceAssignable(array[i].ParameterType, args[i].Type))
2925 {
2926 return false;
2927 }
2928 }
2929 return true;
2930 }
static bool AreReferenceAssignable(Type dest, Type src)
Definition TypeUtils.cs:673

References System.Dynamic.Utils.TypeUtils.AreReferenceAssignable(), and System.array.

Referenced by System.Linq.Expressions.Expression< TDelegate >.FindMethod(), and System.Linq.Expressions.Expression< TDelegate >.FindProperty().