Skip to content

use min/max instead of LUB/GLB in strong mode inference? #27917

Closed
@jmesserly

Description

@jmesserly

Strong mode inference for generics gathers constraints on the type (lower and upper bounds), and uses that to find a type that satisfies the bounds (in practice, it will pick either the lower or the upper). Right now, these bounds are computed using LUB and GLB as appropriate to combine constraints. But that causes us to synthesize a type that the user did not write down anywhere, not to mention depending on the LUB/GLB functions.

I tried a switch to min/max but it causes a lot of churn in tests, so I'd like to handle this as a separate issue from our other inference changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions