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

return at end of pipeline that causes return return if the pipeline was at the end of a function #1675

Closed
nicholaides opened this issue Jan 5, 2025 · 1 comment · Fixed by #1676
Assignees
Labels
bug Something isn't working

Comments

@nicholaides
Copy link

Input:

function f()
  1 |> return

Actual Output:

function f() {
  return return 1
}

When you run it you'll get SyntaxError: expected expression, got keyword 'return'

Expected Output:

function f() {
  return 1
}

Seem like either:

  1. the extra return should be removed
  2. it should be a syntax error at compile time
@edemaine
Copy link
Collaborator

edemaine commented Jan 5, 2025

Funny, I think implicit return is adding the second return. Definitely a bug!

You can add a trailing ; as a workaround for now.

@edemaine edemaine added the bug Something isn't working label Jan 5, 2025
@edemaine edemaine self-assigned this Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants