783 {
784 if (c1 == c2)
785 {
786 return 0;
787 }
789 {
790 if (
pattern.MatchesExactly(c1))
791 {
792 return 1;
793 }
794 if (
pattern.MatchesExactly(c2))
795 {
796 return 2;
797 }
798 }
799 else
800 {
801 if (c1 == t)
802 {
803 return 1;
804 }
805 if (c2 == t)
806 {
807 return 2;
808 }
809 }
810 if (c1.IsByRef || c2.IsByRef)
811 {
812 if (c1.IsByRef && c2.IsByRef)
813 {
814 c1 = c1.GetElementType();
815 c2 = c2.GetElementType();
816 }
817 else if (c1.IsByRef)
818 {
819 if (c1.GetElementType() == c2)
820 {
821 return 2;
822 }
823 c1 = c1.GetElementType();
824 }
825 else
826 {
827 if (c2.GetElementType() == c1)
828 {
829 return 1;
830 }
831 c2 = c2.GetElementType();
832 }
833 }
834 bool flag;
835 bool flag2;
836 if (c1.IsPrimitive && c2.IsPrimitive)
837 {
840 }
841 else
842 {
843 flag = c1.IsAssignableFrom(c2);
844 flag2 = c2.IsAssignableFrom(c1);
845 }
846 if (flag == flag2)
847 {
848 return 0;
849 }
850 if (flag)
851 {
852 return 2;
853 }
854 return 1;
855 }
static bool CanChangePrimitive(Type source, Type target)