Hacker News new | ask | show | jobs
by chrisseaton 2056 days ago
> Crystal does global type inference

I think they stepped back from this a few years ago. It's not globally inferred anymore - you need to specify some types manually.

1 comments

Yes. The basic rule is that things that could be stored on the heap will need to be explicit or inferrable directly from the constructors. But as method parameters generally (except sometimes, like in procs) don't need typing it is quite possible to build full programs using only global inferrence. But that is usually not how programs are built - that would do away with things like objects and structs and other constructs that are extremely ideomatic.