tree-sitter-c icon indicating copy to clipboard operation
tree-sitter-c copied to clipboard

Implicit function return type

Open Aerijo opened this issue 6 years ago • 1 comments

So I recently learned functions can omit the return type. Googling this tells me this has been deprecated, but my tests still let me compile without it.

Currently, leaving out the return type will cause the function name to be misinterpreted as the type, and the rest of the highlighting will be broken. Is this something worth fixing? Is it even possible (easily), given that a function name has the same form as a custom return type?

Aerijo avatar Oct 30 '18 01:10 Aerijo

I think it is possible; we may even already allow it over in tree-sitter-cpp because C++ constructor definitions basically look like functions with no return type.

maxbrunsfeld avatar Mar 05 '19 00:03 maxbrunsfeld