There's a special name for it, but I can't remember what it is. There are two different terms, one for casting an array of a subclass to an array of its superclass, and the other way around.
views:
187answers:
3No, it's a term that has to do with casting arrays.
Max Schmeling
2009-07-31 19:17:24
I honsetly cant think of any term that would pertain to arrays specifically. +1 for interesting question.
Neil N
2009-07-31 19:26:10
@Steve: I think you're right. More information about Covariance and Contravariance in C# here: http://blogs.msdn.com/ericlippert/archive/2007/10/16/covariance-and-contravariance-in-c-part-one.aspx
Grant Wagner
2009-07-31 19:23:43
I included the link because Part One talks about Covariance and Contravariance in more general terms, in case people want some background on what they are.
Grant Wagner
2009-07-31 19:24:55
I guess from reading that msdn blog post it doesn't apply to arrays specifically. But it is what I was thinking of.
Max Schmeling
2009-07-31 19:43:05
@Max: Part Two of Eric's series deals specifically with Array Covariance (but not Contravariance) (in C#): http://blogs.msdn.com/ericlippert/archive/2007/10/17/covariance-and-contravariance-in-c-part-two-array-covariance.aspx
Grant Wagner
2009-07-31 20:03:54
Hey this answer is simply WRONG. These may be what you had in mind but these ARE NOT names for array upcasting/downcasting!
zvolkov
2009-08-01 23:51:24
+3
A:
Array Upcasting and Array Downcasting.
EDIT: Covariance and Contravariance is ability to treat certain types as same or not the same depending on composition and inheritance semantics. This has nothing to do with casting arrays, which just happen to be one case where co-variance comes into play.
zvolkov
2009-07-31 19:21:32
You know, that would have been a whole heck of a lot easier to remember than Co-variance and Contra-variance. Maybe we should change the terminology? lol
Max Schmeling
2009-07-31 19:40:11