Hello AST experts,
I'm implementing callables, as proposed in this pitch. The pitch introduces a new
call declaration for declaring callable methods:
call declarations are function-like, similar to the existing
We're aware that adding a new declaration kind is controversial. But unless it's a non-starter due to insurmountable issues, we'd like to explore that design.
Implementation question: should the new
CallDecl inherit from
Looking at other function-like declaration kinds:
AccessorDecl inherits from
ConstructorDecl does not. (
SubscriptDecl is not really comparable: it inherits from
AbstractStorageDecl and contains
The pro of conforming
FuncDecl is code-sharing: there's no need to reimplement parts of SILGen/IRGen for
FuncDecl stores extra info unused by
CallDecl, which is not efficient.