typeof(T).IsAssignableFrom does not work as I expected - C#