gleam icon indicating copy to clipboard operation
gleam copied to clipboard

Move from using placeholder expression to optional function body

Open abs0luty opened this issue 1 year ago • 0 comments

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.

abs0luty avatar Dec 30 '23 17:12 abs0luty