supertype[] is not a supertype of subtype[] if supertype and subtype alone are in that relationship, because the mutability of arrays means that the Liskov substitution principle doesn’t hold.
(These are all something you’ll probably find good explanations of on Wikipedia.)
Thank you for your reply. Sadly I don’t know terms like covariant or supertype either 😅 so I’ll have to look into all that when/if it comes up. I write in GDScript for fun (a game engine’s high-level scripting language said to have syntax similar to Python).
Invariant?
Neither covariant nor contravariant.
supertype[] is not a supertype of subtype[] if supertype and subtype alone are in that relationship, because the mutability of arrays means that the Liskov substitution principle doesn’t hold.
(These are all something you’ll probably find good explanations of on Wikipedia.)
Thank you for your reply. Sadly I don’t know terms like covariant or supertype either 😅 so I’ll have to look into all that when/if it comes up. I write in GDScript for fun (a game engine’s high-level scripting language said to have syntax similar to Python).