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.
Problem
An
ifexpression currently returns the least upper bound of its true and false branch types without reporting when the branches are incompatible and neither isAny.Desired outcome
Add a warning or error that identifies incompatible branch result types, with an appropriate policy for
AnyandNever.Location
ndc_analyser/src/analyser.rs,Expression::If.