Closed yiming-fang closed 1 year ago
@j-hui I am not super familiar with the PatDef
and PatFn
; in particular, how are the patterns in these data types actually being used by the AST? Are the patterns used in definitions like the following?
foo [] = ...
foo (x:xs) = ...
Or are these patterns something else entirely.
This PR adds recursive pattern matching in the IR and also fixes the later passes that are affected by this change. All passes after type checking will assume that the patterns are non-recursive even though recursive patterns are expressible.
Recursive patterns in the IR are a prerequisite for moving the desugaring and exhaustion-checking to the IR, i.e., after type checking.