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
I read that some people find the type erasure proposal not trustworthy as tools such as TypeScript and Flow have different type checking behavior and may also vary due to version upgrades.
If the proposal was taking the runtime types approach, possibly there could be a special treatment of complex types such as union and complement types, similiar to polymorphism:
Complex types are checked at compile time for correctness
Complex types are converted to any at runtime.
For example, consider the following program:
type U = "n1" | "n2";
const v: U = "nN";
The above program generates a compile time verify error. If it were valid, it'd translate to:
const v: any = "nN";
Complex types include:
Union types
Complement types
Type parameters
Structural function types
Tuple types
Structural object types
The text was updated successfully, but these errors were encountered:
I read that some people find the type erasure proposal not trustworthy as tools such as TypeScript and Flow have different type checking behavior and may also vary due to version upgrades.
If the proposal was taking the runtime types approach, possibly there could be a special treatment of complex types such as union and complement types, similiar to polymorphism:
any
at runtime.For example, consider the following program:
The above program generates a compile time verify error. If it were valid, it'd translate to:
Complex types include:
The text was updated successfully, but these errors were encountered: