public static Type GetNonRefType(this Type type) { return type.IsByRef ? type.GetElementType() : type; }