From 4d8a4078990a00ffdc018bc8f5d4d5e3dcf6527d Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Tue, 18 Dec 2018 19:45:02 +0000 Subject: 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. --- test/typecheck/pass/tyvar_names.sail | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/typecheck/pass/tyvar_names.sail (limited to 'test/typecheck') 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 + +$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 -- cgit v1.2.3