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

Attempted pattern matching ternary #1236

Open
bbrk24 opened this issue May 9, 2024 · 1 comment
Open

Attempted pattern matching ternary #1236

bbrk24 opened this issue May 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bbrk24
Copy link
Contributor

bbrk24 commented May 9, 2024

undo := => engine = Engine.fromJSON json if json? := history.pop()
const undo = () =>(const json? = history.pop()? engine = Engine.fromJSON(json):void 0)

Workaround: put the function body on the next line

undo := =>
  engine = Engine.fromJSON json if json? := history.pop()
@edemaine edemaine added the bug Something isn't working label May 9, 2024
@edemaine
Copy link
Collaborator

edemaine commented May 9, 2024

A workaround for now:

undo := =>
  engine = Engine.fromJSON json if json? := history.pop()

So this is probably specific to the "don't wrap fat arrow in braces if it's a one-line expression" rule.

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

No branches or pull requests

2 participants