mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
a83871b948
* damlc: Check DAML-LF pattern matches for exhaustiveness `damlc` has always produced exhaustive pattern matches in DAML-LF since GHC adds a default branch with a call to `error` message as soon as a pattern match is not exhaustive. It was a complete oversight on our side that we did not enforce this properly in DAML-LF. Since `damlc` has never produced non-exhaustive pattern matches, enforcing this now and for all DAML-LF versions is only theoretically a breaking change, namely if people hand-crafted DAML-LF, but not practically. This check is as under-tested as the rest of our Haskell implementation of the DAML-LF type checker. Well, all our other tests implicitly check that the type checker does not give false errors. However, we have no tests ensuring that the type checker is not too permissive. Fixing this situation would require a big time investment since we currently don't have a simple way to produce DAML-LF without going through GHC, which will always produe well-typed DAML-LF. I will update the DAML-LF specification wrt pattern matching exhaustiveness in a separete PR. This PR does not have a changelog entry since there's no impact for our users. CHANGELOG_BEGIN CHANGELOG_END * Make check linear in match size not constructor number CHANGELOG_BEGIN CHANGELOG_END * Move lookupWithIndex in Data.List.Extended CHANGELOG_BEGIN CHANGELOG_END * Implement the suggestions CHANGELOG_BEGIN CHANGELOG_END |
||
---|---|---|
.. | ||
bazel-runfiles | ||
da-hs-base | ||
test-utils |