Add "leading dot" syntax, enabled by type inference #274
Labels
BLOCKED
We can't or shouldn't work on this yet, for reasons explained in the ticket and/or comments.
complexity 2: significant
This is non-trivial, but still not a major undertaking
kind: feature: language
Adding a new language feature
Swift has this nifty feature they call Implicit Member Expression, which is often used for enums, but can also be used for static functions/variables.
In Savi we could use a similar feature for enums, static functions (
fun non
) and constructors (new
).The basic idea is that if the expression
.baz
can be used as shorthand forFoo.Bar.baz
in a place where the type inference system knows that the typeFoo.Bar
is expected.Here are some examples of places in real Savi code that could be made more succinct:
The text was updated successfully, but these errors were encountered: