A Debug.Assert is a no-op in Release configuration (it uses
ConditionalAttribute("DEBUG")), thus allowing the bad type through.