hylo
hylo copied to clipboard
Implement '@autoclosure'
The feature should work similarly as it does in Swift.
Note: @autoclosure
is necessary to properly implement shortcut behavior in Bool.infix&&
This issue can be split into several steps:
- Implement syntactic support for parameter attributes, including
@autoclosure
- Make sure that
@autoclosure
attributes have a type[E]() -> T
- Let the type inferrer accept arguments of type
T
to be passed to parameters of type[E]() -> T
- Synthesize the construction of a lambda when an argument is passed to an
@autoclosure
parameter at the IR level
We might have to discuss whether auto closures are allowed to be mutating. We may also want sugar for the declaration of their environment E
.