Currently, a pattern like (trivia:lambda-match ('foo 42)) will erroneously add a type declaration of (eql 'foo) to the variable that matches 'foo. The correct declaration would be (eql foo). Currently, the automatically generated type declarations for EQ, EQL, EQUAL and EQUALP are wrong for everything but self evaluating objects.
This problem manifests itself when optimizing a pattern like (trivia:lambda-match ((or 'x 'x) 42)) with the balland2006 optimizer. Here, SBCL will emit the following warning:
; Derived type of #:fusion5 is
; (values (member x) &optional),
; conflicting with its asserted type
; (values (member (quote x)) &optional).
Thanks for pointing it out. The issue is valid.
Ill merge the fix after work, but your fix still has some problems so I'll append some commits after it.
Currently, a pattern like
(trivia:lambda-match ('foo 42))
will erroneously add a type declaration of (eql 'foo) to the variable that matches 'foo. The correct declaration would be (eql foo). Currently, the automatically generated type declarations for EQ, EQL, EQUAL and EQUALP are wrong for everything but self evaluating objects.This problem manifests itself when optimizing a pattern like
(trivia:lambda-match ((or 'x 'x) 42))
with the balland2006 optimizer. Here, SBCL will emit the following warning:I attached a potential fix.
PS: Thank you for providing this amazing library!