JSMonk / hegel

An advanced static type checker
https://hegel.js.org
MIT License
2.09k stars 59 forks source link

Problem with type refinement #179

Open srg-kostyrko opened 4 years ago

srg-kostyrko commented 4 years ago

https://hegel.js.org/try#GYVwdgxgLglg9mABFApgZygChmADiKALkXAGsw4B3MASkQG8AoRRGYRTKAT1xTnZz4oiALxjEAcjgAjAFYpoExADJlrPAUQBCcWBAAbfXSYsW+lMIBOKYDhQATUeqEBuRAHp3iOKWeaYaN5yCsIAFijWzIgAvoxRbByCmjoiiHqGKmrcvPx+wmKpUsGKxlFmFojWtmAOTklQbp6IEZZwlnmsgTUAbhFRsdFAA

for some reason, if we first check that variable is not null and after that use typeof check - variable is refined to never if we reverse check order - everything works

Kapelianovych commented 4 years ago

@srg-kostyrko, link is pointed to localhost) Can you point it to Hegel's playground?

srg-kostyrko commented 4 years ago

I updated the link