emacs-elsa / Elsa

Emacs Lisp Static Analyzer and gradual type system.
GNU General Public License v3.0
640 stars 26 forks source link

Elsa crashes on reading `'(x . y)` syntax #176

Closed ethan-leba closed 2 years ago

ethan-leba commented 3 years ago

Steps to reproduce

  1. Make a file with the following contents:

    '(foo . foo)
  2. Run cask exec elsa bug.el.

  3. Receive the following error:

    Wrong type argument: listp, #s(elsa-form-symbol 9 12 nil 1 8 #s(elsa-type-mixed) nil #s(trinary 1) unbound ...)

Not sure if this syntax is explicitly not supported by elsa or something. (cons 'foo 'foo) works fine, but I'm using the . syntax for pattern matching, which makes cons inconvenient.

Thanks for this cool plugin! (is this still alive?)

Fuco1 commented 3 years ago

All the valid syntax is supported so this should also work.

The project is currently hibernating, but I still want to get back to it eventually, if only for the intellectual fun of it.

ethan-leba commented 2 years ago

The issue appears to be due to an upstream change with dash.el -- I've opened a small PR if you have time to take a look 👍

Fuco1 commented 2 years ago

Yes, this is due to dash.el indeed... I've just spent some time debugging it when you already did the work :man_facepalming: I even did the same change than you did to fix it. I'll revert my changes and merge your code in recognition of your help and my futility. Thanks!