sinelaw / infernu

Type inference and checking for a safer JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow specifying types (type annotations)

sinelaw opened this issue · comments

There are a few cases that are unsolvable without type annotations. For example, polymorphic row fields - always generalizing EPropAssign (row field assignment) means inferring overly polymorphic types that may cause errors later when code that assigns a less polymorphic type is encountered.

The only solution is to not generalize EPropAssign, but allow users to manually specify a (possibly polymorphic) type using type annotations.