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

static type checking #11

Closed
19 tasks done
Tracked by #1
michal-kapala opened this issue Dec 15, 2023 · 0 comments
Closed
19 tasks done
Tracked by #1

static type checking #11

michal-kapala opened this issue Dec 15, 2023 · 0 comments
Assignees
Labels
core Core feature parser Related to parser module typechecker Related to typechecker module

Comments

@michal-kapala
Copy link
Owner

michal-kapala commented Dec 15, 2023

Important LSP server feature that would allow it to return implicit conversion warnings or type errors without evaluation:

  • unknown return type needed for some functions (such as RunScript) and globals
  • error and warning collection
  • identifier type info collection from AST nodes (variables, function names from call expressions)
  • expression type inference
    • assignments
    • literals
    • local identifiers
    • global/system identifiers
    • binary expressions
    • unary expressions
    • member expressions (dont seem possible without static types of arrays/dicts)
    • block expressions
    • calls (per-function validation)

Challenges

  • signature selection and call argument type validation
  • ArgumentList - the args are uninitialized local identifiers (regular names or _1, _2, _3 etc.), the call should update the env and AST types to unknown
  • default script arg identifier support #14
  • node return type, impossible to guess without a schema (unknown)
  • type return type, sometimes solved by call arg types, sometimes remains ambiguous
  • arg list length validation to be moved off parser (runtime/typechecker switch needed)
@michal-kapala michal-kapala added core Core feature parser Related to parser module labels Dec 15, 2023
@michal-kapala michal-kapala added this to the Package release milestone Dec 15, 2023
@michal-kapala michal-kapala added the typechecker Related to typechecker module label Jan 4, 2024
@michal-kapala michal-kapala mentioned this issue Jan 12, 2024
9 tasks
@michal-kapala michal-kapala self-assigned this Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core feature parser Related to parser module typechecker Related to typechecker module
Projects
Status: Done
Development

No branches or pull requests

1 participant