Introduce a Never
type for diverging expressions
#5524
Labels
code quality
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
compiler: ir
IRgen and sway-ir including optimization passes
compiler
General compiler. Should eventually become more specific as the issue is triaged
The typechecker currently uses the
Unknown
type both as a placeholder for a not-yet-determined type, and to indicate the type of a (typechecked) diverging expression (e.g.,return
,break
orcontinue
). This conflation causes some convoluted IR generation code because the code generator cannot handleUnkonwn
types.Introducing a
Never
type to indicate diverging expressions would fix this problem, and thus allow a simplification of the IR code generation.The text was updated successfully, but these errors were encountered: