summaryrefslogtreecommitdiff
path: root/src/reporting_basic.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-10-31 14:56:19 +0000
committerAlasdair Armstrong2018-10-31 14:56:19 +0000
commit5298e209f0ae12e51f3050888e18ad9be09543e4 (patch)
tree86b405e9882b5b3b979c77cb14e57966f73f7e3d /src/reporting_basic.ml
parent546bd3e14957199cc1efc0810fb4a2c58ba23fde (diff)
Improve error messages for unsolved function quantifiers
For example, for a function like ``` val aget_X : forall 'n, 0 <= 'n <= 31. int('n) -> bits(64) function test(n : int) -> unit = { let y = aget_X(n); () } ``` we get the message > Could not resolve quantifiers for aget_X (0 <= 'ex7# & 'ex7# <= 31) > > Try adding named type variables for n : atom('ex7#) > > The property (0 <= n & n <= 31) must hold which suggests adding a name for the type variable 'ex7#, and gives the property in terms of the variable n. If we give n a type variable name: ``` val test : int -> unit function test(n as 'N) = { let y = aget_X(n); () } ``` It will suggest a constraint involving the type variable name > Could not resolve quantifiers for aget_X (0 <= 'ex6# & 'ex6# <= 31) > > Try adding the constraint (0 <= 'N & 'N <= 31)
Diffstat (limited to 'src/reporting_basic.ml')
0 files changed, 0 insertions, 0 deletions