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

feat(fast_check): syntax based type inference #481

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lucacasonato
Copy link
Member

This commit updates fast check to perform syntax based type inference on
variable initalizers and function return values. The inferred types are
then used as variable declaration type annotations, or function return
type annotations respectively.

This is a first step in removing leavable types in favor of an aligned
.d.ts and .ts emit.

This commit also adds a slew of new diagnostic information to help users
understand why a type was unable to be inferred. It gives more helpful
messages than the previous "add an explicit type" messages.

TODO:

  • more tests
  • finalize the error for referring to local variables

This includes type params, function params, and params declared through `infer X` in type annotations.
This commit updates fast check to perform syntax based type inference on
variable initalizers and function return values. The inferred types are
then used as variable declaration type annotations, or function return
type annotations respectively.

This is a first step in removing leavable types in favor of an aligned
`.d.ts` and `.ts` emit.

This commit also adds a slew of new diagnostic information to help users
understand why a type was unable to be inferred. It gives more helpful
messages than the previous "add an explicit type" messages.

TODO:
- more tests
- finalize the error for referring to local variables
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

Successfully merging this pull request may close these issues.

1 participant