You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keeping notes of TODOs for TypVal. This list will be updated as progress occurs.
Embedded External Annotations: allow annotating types/signatures for external
"#extern foo"<int;varx=foo;// x implied as 'int'"#extern SomeUtil"<func`(string, number) => bool`;vary=SomeUtil("hello","world");// error on "world" not being 'number', y implied as 'bool'
Also, we need to define a (huge) set of these external annotations (to be imported via JSON, perhaps?) for all the built-ins and natives, such as encodeURI(..), console.log(..), JSON.stringify(..), etc.
Cross-typing: option to collect global types/signatures from non-modules, and exported types/signatures from modules, and "export" them possibly as JSON, and then "import" them for a file as "external annotations". Allows checking multiple files together in a group.
Generic types for function params/signatures, by allowing signature overloading
functionfoo(x=generic){returnx;}vara=foo(3);// `a` is type 'number'varb=foo("abc");// no error, since signature is overloaded, `b` is type 'string'
Enforce TDZ for var, as well as (separately) TDZ for let / const, as well as (separately) TDZ for function declarations
Function typed-shorthand:
func`(int,string) => bool`;// returns a function like:// (x,y) => { x = int`${x}`; y = string`${y}`; return bool`false`; }
functionbar(cb=func`int => string`){varx=int`0`;x=cb("hello");// reports error with "hello" not matching `int` param// reports error with `x` being an `int` but trying to assign a `string` to it}varb=func`int => string`;
Keeping notes of TODOs for TypVal. This list will be updated as progress occurs.
Embedded External Annotations: allow annotating types/signatures for external
Also, we need to define a (huge) set of these external annotations (to be imported via JSON, perhaps?) for all the built-ins and natives, such as
encodeURI(..)
,console.log(..)
,JSON.stringify(..)
, etc.Cross-typing: option to collect global types/signatures from non-modules, and
export
ed types/signatures from modules, and "export" them possibly as JSON, and then "import" them for a file as "external annotations". Allows checking multiple files together in a group.Generic types for function params/signatures, by allowing signature overloading
Enforce TDZ for
var
, as well as (separately) TDZ forlet
/const
, as well as (separately) TDZ for function declarationsFunction typed-shorthand:
Custom types (via scope-hoisted pragmas)
Sub types:
The text was updated successfully, but these errors were encountered: