gleam
gleam copied to clipboard
Move from using placeholder expression to optional function body
I'm already working on this one, just made an issue.
Basically, what is now used in type inference to depict that a function doesn't have a body because of external implementations or parsing is incomplete is a placeholder expression:
/// A placeholder used when parsing is incomplete or when a function body is
/// missing due to an external implementation being given for the function
/// instead.
/// TODO: This variant should be removed in future, but it requires some
/// rework of the type inference code to be able to handle functions that do
/// not have a body.
Placeholder {
location: SrcSpan,
},
What we can do is make body field in function definition optional, to get rid of it.