Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing #9

Open
sco1 opened this issue Nov 30, 2021 · 2 comments
Open

Fix typing #9

sco1 opened this issue Nov 30, 2021 · 2 comments

Comments

@sco1
Copy link
Owner

sco1 commented Nov 30, 2021

Once Mypy is updated to support pattern matching, need to go through and make sure our typing is correct.

@sco1 sco1 added the deferred For some reason this can't be worked on right now label Nov 30, 2021
@sco1
Copy link
Owner Author

sco1 commented Jan 19, 2022

Support for this is now on mypy's master branch, so the poking around on this can commence.

mypy's next release (0.940) is expected sometime in February.

@sco1 sco1 removed the deferred For some reason this can't be worked on right now label Jan 28, 2022
@sco1
Copy link
Owner Author

sco1 commented Jan 28, 2022

Most of the low hanging fruit should now be taken care of, leaving a couple major things to work on:

  • LoxArray
    • While everything works at runtime, inheriting from LoxInstance is causing some non-trivial (I think) typing issues, mostly around re-using fields to hold LoxArray's internal data as a deque vs. LoxInstance's dict. I'm not sure if this needs an entire refactor or if we can do something like putting the deque into a "__data__" field instead.
  • Interpreter
    • The type narrowing, particulary with visitors like visit_Binary is a bit of a mess. Will have to take a look and see what we can do to narrow our left/right expressions down from Any to make the typing robust.
  • AstPrinter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant