teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.03k stars 101 forks source link

fix `is` inference taking into account that unions imply nil #699

Closed hishamhm closed 9 months ago

hishamhm commented 9 months ago

This behavior will change one day when we make types not imply nil, but for now we need to be consistent with the fact that they do.

So silence the warning on the last elseif V is T and drop the error in the else case.

Fixes #695.

github-actions[bot] commented 9 months ago

Teal Playground URL: https://699--teal-playground-preview.netlify.app