denoland / deno_graph

The module graph logic for Deno CLI
https://docs.rs/deno_graph
MIT License
112 stars 39 forks source link

feat(fast_check): syntax based type inference #481

Open lucacasonato opened 5 months ago

lucacasonato commented 5 months ago

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: