Annotate AST nodes with Type
, not Polytype
#1042
Labels
Bug
The observed behaviour is incorrect or unexpected.
C-Project
A larger project, more suitable for experienced contributors.
L-Type inference
The process of inferring the type of a Swarm expression.
L-Type system
Issues related to the Swarm language type system.
S-Moderate
The fix or feature would substantially improve user experience.
Z-Research
This issue requires inventing something new and/or studying research papers for clues.
I've realized a big issue with the way this works: in particular it doesn't make sense to annotate every node of the AST with a
Polytype
; we should instead have a singlePolytype
for the entire thing at the top level, and annotate every node with aType
. For example suppose we havedef wow = \x. format x ++ "!" end
. The type ofwow
will correctly be inferred asforall a. a -> text
, but if you hover overx
, its type will be shown asforall a. a
which does not make any sense. It should just have typea
, or perhaps some made-up type variable likes0
. I think I have an idea how to fix this...Originally posted by @byorgey in #991 (comment)
The text was updated successfully, but these errors were encountered: