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

Ability to specify optional return type #7

Open
duckinator opened this issue Jan 21, 2020 · 0 comments
Open

Ability to specify optional return type #7

duckinator opened this issue Jan 21, 2020 · 0 comments
Labels

Comments

@duckinator
Copy link

(Opening as requested by @kayila after talking to her about it.)

While not restricting the return type is a reasonable default behavior for a scripting language, it would be nice to be able to opt-in to it when wanted.

I'm thinking something like this, where the -> int specifies the return type and is optional:

function factorial(int n) -> int {
    if (n == 1) {
        return 1;
    }
    return n * factorial(n - 1);
}

If no return type is specified, it'd probably make the most sense to not restrict it in any way.

@kayila kayila added the feature label Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants