teal-language / tl

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

fix: in function calls, infer self before return #623

Closed hishamhm closed 1 year ago

hishamhm commented 1 year ago

A tricky aspect of bidirectional flow typing: let's ensure that in a method, the self type flows down before the return type flows up.

Also, the test case demonstrates that the table map type has bivariant behavior to ease the transition of Lua code.

Fixes #619.

github-actions[bot] commented 1 year ago

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