cryptol/tests/constraint-guards
Ryan Scott fbbbb8f56f
Check for syntactically invalid constraint guards in the parser (#1686)
Numeric constraint guards have very particular syntactic requirements:

* They must always be used in top-level definitions.
* Their definitions must always be accompanied by a top-level type signature.

Previously, we checked these requirements in a combination of places in the
parser and the typechecker. The checks in the typechecker weren't very
thorough, however, and they failed to catch local definitions without type
signatures that use constraint guards, as seen in #1685.

This patch moves all of these syntactic checks to the parser (in
`Cryptol.Parser.ExpandPropGuards`). We now recurse into expressions to check
for local definition that use constraint guards and error if we encounter one.
This ensures that by the time we reach the typechecker, all constraint guard
expressions are at least syntactically valid.

Fixes #1685.
2024-07-01 07:13:36 -04:00
..
constant.cry constant tests for constraint guards 2022-08-30 11:56:45 -07:00
constant.icry constant tests for constraint guards 2022-08-30 11:56:45 -07:00
constant.icry.stdout constant tests for constraint guards 2022-08-30 11:56:45 -07:00
inits.cry * Introduce a separate type for a property guarded alternative 2022-09-06 18:56:20 +03:00
inits.icry properly set up test suite 2022-08-26 12:39:28 -07:00
inits.icry.stdout properly set up test suite 2022-08-26 12:39:28 -07:00
insert.cry proper uncapitalized names 2022-08-29 10:41:03 -07:00
insert.icry properly set up test suite 2022-08-26 12:39:28 -07:00
insert.icry.stdout Simplify type checking of constraint guards 2022-09-12 11:35:34 +03:00
len.cry proper uncapitalized names 2022-08-29 10:41:03 -07:00
len.icry properly set up test suite 2022-08-26 12:39:28 -07:00
len.icry.stdout properly set up test suite 2022-08-26 12:39:28 -07:00
mergesort.cry proper uncapitalized names 2022-08-29 10:41:03 -07:00
mergesort.icry properly set up test suite 2022-08-26 12:39:28 -07:00
mergesort.icry.stdout properly set up test suite 2022-08-26 12:39:28 -07:00
nestFun.cry Update evaluator to account for TError of kind prop. 2022-09-28 15:17:39 +03:00
nestFun.icry Update evaluator to account for TError of kind prop. 2022-09-28 15:17:39 +03:00
nestFun.icry.stdout Update evaluator to account for TError of kind prop. 2022-09-28 15:17:39 +03:00
nestMod.cry Clean up translation, and support for nested modules 2022-09-12 14:57:44 +03:00
nestMod.icry Clean up translation, and support for nested modules 2022-09-12 14:57:44 +03:00
nestMod.icry.stdout Clean up translation, and support for nested modules 2022-09-12 14:57:44 +03:00
noNested.cry Another test 2022-09-12 14:58:18 +03:00
noNested.icry Another test 2022-09-12 14:58:18 +03:00
noNested.icry.stdout Check for syntactically invalid constraint guards in the parser (#1686) 2024-07-01 07:13:36 -04:00
noPrim.cry Report an error if we find unsupported constraints 2022-09-13 13:53:46 +03:00
noPrim.icry Report an error if we find unsupported constraints 2022-09-13 13:53:46 +03:00
noPrim.icry.stdout Fix tests 2022-09-27 11:46:08 +03:00
noTypeSig.cry Check for syntactically invalid constraint guards in the parser (#1686) 2024-07-01 07:13:36 -04:00
noTypeSig.icry Check for syntactically invalid constraint guards in the parser (#1686) 2024-07-01 07:13:36 -04:00
noTypeSig.icry.stdout Check for syntactically invalid constraint guards in the parser (#1686) 2024-07-01 07:13:36 -04:00
noTypeSigNested.cry Check for syntactically invalid constraint guards in the parser (#1686) 2024-07-01 07:13:36 -04:00
noTypeSigNested.icry Check for syntactically invalid constraint guards in the parser (#1686) 2024-07-01 07:13:36 -04:00
noTypeSigNested.icry.stdout Check for syntactically invalid constraint guards in the parser (#1686) 2024-07-01 07:13:36 -04:00
tail.cry properly set up test suite 2022-08-26 12:39:28 -07:00
tail.icry properly set up test suite 2022-08-26 12:39:28 -07:00
tail.icry.stdout properly set up test suite 2022-08-26 12:39:28 -07:00
type-sig-constraint.cry Fix typechecking of constraint guards with type signature constraints 2024-03-25 12:26:34 -04:00
type-sig-constraint.icry Implement coreLint for numeric constraint guards 2024-03-25 13:13:00 -04:00
type-sig-constraint.icry.stdout Implement coreLint for numeric constraint guards 2024-03-25 13:13:00 -04:00