Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: allow for not having to redeclare function types #896

Open
lucillablessing opened this issue Jan 5, 2025 · 0 comments
Open
Labels
feature request New feature or request

Comments

@lucillablessing
Copy link

I wish that if a function was forward-declared, as in

local add: function(number, number): number

-- ...

function add(x: number, y: number): number
   return x + y
end

then I didn't need to redeclare the types of the arguments and the result, i.e. I could write this:

local add: function(number, number): number

-- ...

function add(x, y)
   return x + y
end

Obviously this conflicts with functions that have no return value, so if this was ever implemented, some other part of Teal semantics would need to change in a backwards-incompatible way.

@hishamhm hishamhm added the feature request New feature or request label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants