aka “bros: in order to be rich, just don’t be poor.”

  • gedhrel@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 days ago

    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.)