earl-grey icon indicating copy to clipboard operation
earl-grey copied to clipboard

Embedded shorthand pattern match doesn't work in async functions

Open davej opened this issue 9 years ago • 0 comments

For example, this fails with Illegal clause error:

async manual-install = (match) ->
    "Nginx" -> await nginx-setup.manual-details()
    "Apache" -> await apache-setup.manual-details()

But the longhand works fine:

async manual-install = (type) ->
   match type:
      "Nginx" -> await nginx-setup.manual-details()
      "Apache" -> await apache-setup.manual-details()

davej avatar Aug 06 '15 12:08 davej