jashkenas / jashkenas/coffeescript

Bug: Switch statements cannot be one-lined

Open
#5,127 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
CoffeeScript
Stars
16.6k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

Choose one: is this a bug report or feature request?

Bug

### Input Code

```coffee
switch when true then yes
```

and

```coffee
switch a when true then yes
```

### Expected Behavior

The above should compile

### Current Behavior

It does not compile

### Possible Solution

### Context

### Environment

* CoffeeScript version:
* Node.js version:

Contributor guide

Open the contributing guide

Research direction

Start by compiling the two switch examples from the issue and compare their failures with nearby switch syntax in the CoffeeScript compiler. Done means both one-line forms compile successfully; the issue does not identify a source file, test, or CoffeeScript and Node.js version.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.