Comment by hongbo_zhang

2 years ago

Not strictly necessary, we are not decided on it.

For func the annotation is required, while fn does not need any type annotation

I would strongly recommend to only go with one syntax, and not differentiate between regular functions and lambda statement

  • I disagree - allowing for type inference on the closures will make for a much more pleasant language, whereas requiring type annotations on top level functions makes sense for lots of reasons.

    • > allowing for type inference on the closures

      You can still have your type inference without forcing the unnecessary requirement that local functions be `fn` while top functions be `func`.

      2 replies →