Skip to content

variance 变型 #143

Open
Open
@towry

Description

@towry

The core problem is that this rule, naively applied, will lead to meowing Dogs. That is, we can convince someone that a Dog is actually a Cat. This completely destroys the fabric of our static type system, making it worse than useless (and leading to Undefined Behaviour).

Clearly, we need a more robust system than "find and replace". That system is variance, which is a set of rules governing how subtyping should compose. Most importantly, variance defines situations where subtyping should be disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions