Consequences of array covariance in C#

Posted on Fri 22 October 2021 in Coding • Tagged with csharp, covariance, cast

In today’s post, I’ll talk about array covariance in C#, how it hid a bug in code that was covered by a passing unit test (*gasp*), and some ideas for how to avoid such bugs.

What is covariance?

In computer science, variance has to do with how complex …

Continue reading