[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH 5] Fix compiler-typecase trail restore
From: |
megane |
Subject: |
[Chicken-hackers] [PATCH 5] Fix compiler-typecase trail restore |
Date: |
Thu, 26 Apr 2018 17:05:58 +0300 |
User-agent: |
mu4e 0.9.18; emacs 25.1.1 |
Hi,
Here's a small fix.
Consider this example:
(compiler-typecase (list 2 'a)
((forall (x) (list x x)) 1)
(else #t))
Trying to compile this causes an error in the compiler:
Error: (cdr) bad argument type: #f
In this typecase the first case fails (cannot match/unify 2 and 'a). The
failed match however leaves type variable 'x' in the trail.
The call (trail-restore trail0 typeenv) tries to restore the trail. But
it uses the typeenv from '(list 2 'a)', which doesn't contain the type
variable 'x'. It should instead use the typeenv used in the match-types
call, the combination of typeenvs for '(forall (x) (list x x))' and
'(list 2 'a)'.
<<< message/external-body; name="/home/nabe/tmp/compiler-typecase-trail-restore-fix.patch"; access-type=local-file: Unrecognized >>>
- [Chicken-hackers] [PATCH 5] Fix compiler-typecase trail restore,
megane <=