emacs-elsa / Elsa

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

[Question] How to handle cl-defstructs from other, require'd packages? #173

Closed nbfalcon closed 1 year ago

nbfalcon commented 3 years ago

In my project I require flycheck and make use of one of its types: flycheck-error. It is defined with cl-defstruct. When I specify a type signature making use of it (as per the readme, just specifying the struct name) as '(flycheck-projectile-buffer-errors :: Buffer -> [flycheck-error])', I get an error: Unknown type flycheck-error.

Can Elsa follow requires, or is there some way to define types for elsa explicitly?

Fuco1 commented 3 years ago

There is currently no support for defstruct or classes.

Fuco1 commented 1 year ago

There is now support for defstruct and defclass, both create a type (struct NAME). The support for defclass is currently better as cl-defstruct does not include inheritance yet.