diff options
| author | Alasdair Armstrong | 2018-12-18 19:45:02 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-12-18 19:45:02 +0000 |
| commit | 4d8a4078990a00ffdc018bc8f5d4d5e3dcf6527d (patch) | |
| tree | 5c02008b0958371de3a4f8abca39119c4c4775f4 /test/typecheck | |
| parent | 24c2f4c5d9224d094083e2b4859b39c2ca0b1071 (diff) | |
Experiment with generating type variable names in a repeatable way
This results in much better error messages, as we can pick readable
names that make sense, and should hopefully make the re-writer more
robust.
Diffstat (limited to 'test/typecheck')
| -rw-r--r-- | test/typecheck/pass/tyvar_names.sail | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/typecheck/pass/tyvar_names.sail b/test/typecheck/pass/tyvar_names.sail new file mode 100644 index 00000000..eb31307e --- /dev/null +++ b/test/typecheck/pass/tyvar_names.sail @@ -0,0 +1,25 @@ +default Order dec + +$include <prelude.sail> + +$option -dmagic_hash + +function main((): unit) -> unit = { + let x = (3 + 3) : {'n, 'n == 6. int('n)}; + _check(x : int('x#0)); + let y = (2 + 4) : {'n, 'n == 6. int('n)}; + _check(y : int('y#0)); + let x = 26 : {'n, 'n == 26. int('n)}; + _check(x : int('x#1)); + () +} + +function main2((): unit) -> unit = { + let x = (3 + 3) : {'n, 'n == 6. int('n)}; + _check(x : int('x#0)); + let y = (2 + 4) : {'n, 'n == 6. int('n)}; + _check(y : int('y#0)); + let x = 26 : {'n, 'n == 26. int('n)}; + _check(x : int('x#1)); + () +}
\ No newline at end of file |
