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

Set-theoretic types: inference of patterns and guards #13227

Open
32 of 50 tasks
josevalim opened this issue Jan 5, 2024 · 0 comments
Open
32 of 50 tasks

Set-theoretic types: inference of patterns and guards #13227

josevalim opened this issue Jan 5, 2024 · 0 comments

Comments

@josevalim
Copy link
Member

josevalim commented Jan 5, 2024

The goal of this issue is to track the main tasks for the first milestone of set theoretic types: type inference of patterns and guards, followed by body checking.

Typing description:

  • Non-divisible types (integer, floats, pids, etc)
  • Dynamic
  • Atoms
  • Maps
    • Domain key-types
    • map_fetch
    • map_put
    • map_delete
    • map_keys
    • map_values
  • Tuples
    • Generalize :open / :closed
    • tuple_fetch
    • tuple_insert
    • tuple_delete
    • tuple_values
  • Lists
    • list_hd
    • list_tl
  • Functions
    • apply/2 and fun.(args...)
    • fn ... -> ... end
    • Capture
    • Unions of closures

Type inference and checking:

  • Tracking of variables
  • Type inference of patterns
  • Type inference of guards
  • Type inference of return types
  • Map and struct updates
  • Checking of all inlined functions from Kernel
  • Checking of all inlined conversion functions
  • Checking of __STACKTRACE__ and raising functions
  • Tuple module
  • Map module
  • Storing of inferred types in .beam files
  • Support for local calls
  • Support for remote calls

These are additional features not required for the first milestone:

  • Support for __info__, module_info, and behaviour_info
  • Typing of :erlang inlined functions
  • for comprehensions
  • with comprehensions
  • Detect never matching clauses and patterns (cond, case, receive, try)
  • Detect overlapping clauses (case, receive, try)
  • Exhaustiveness checks
  • Unused clauses in private functions
  • Tracking of mismatches in equality operators
  • Tracking of structs in ordered comparison operators
  • Support for macros
  • Move compile.protocols to parallel compiler
  • Type check private (local?) functions against the union of all call types

For the second and third milestones, see #13881.

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

No branches or pull requests

1 participant