internal static void CheckLegality(Type type)
{
if(IsTypeIllegal(type))
{
throw new InvalidOperationException("Pointer or ThreadLocal or SpinLock encountered during serialization. In order to obtain detailed information including classes path that lead here, please use generated version of serializer.");
}
}