Linear types: enable linting
Currently, linearity is not compatible with Lint, and linear Lint is controlled by a separate flag -dlinear-core-lint
. The objective of this ticket is to make -dcore-lint
do full linearity linting, which will enable it during a normal build.
Part 1 (done !4970 (closed)): Make -dcore-lint
enable linearity checking on the output of the desugarer only.
Part 2 (done !6280 (closed)): Fix test MultConstructor.
Part 3 (in progress): In Lint, assert that multiplicity of a variable and its occurrence match (e.g. in \x -> x
, both x
es should have the same multiplicity)
Part 4: Solve tickets #18694 #17530 (closed) #20058.
Part 5: Fully enable linearity checking. Then, Note [Linting linearity] and -dlinear-core-lint
can be removed.