Skip to content

Diagnose incompatible types in if branches #180

Description

@timfennis

Problem

An if expression currently returns the least upper bound of its true and false branch types without reporting when the branches are incompatible and neither is Any.

Desired outcome

Add a warning or error that identifies incompatible branch result types, with an appropriate policy for Any and Never.

Location

ndc_analyser/src/analyser.rs, Expression::If.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions