Gleam, a statically typed language for the Erlang VM

Well if you look at my TypedElixir it supports typed recursive functions without issue if you need to see any more simplified code compared to bigger compilers then I can fish it out of my playground repo. ^.^

It even trivially detects when a function only ever calls itself and thus becomes a no_return/Never/! return type. No special casing for that either, it’s just when the unification pass is complete and the function type didn’t end up getting resolved. It’s all in the type unificator. ^.^

EDIT: It supports both generic recursion, specific type recursion, and infinite recursion of both previous varieties. ^.^
Like def counter(x), do: counter(x) becomes a no_return/Never/! return type. :slight_smile:
Or even def counter(_x), do: counter(6.28), which types the argument, but the return still remains untyped, not even turned into a Generic type, it just remains an Unbound type.