Compiler panic when using a switch inside an expression #45

Closed
opened 2026-08-26 13:51:09 +00:00 by ed · 1 comment
Owner

This is currently not supported by the Q compiler but it shouldn't lead to a compiler panic:

main() {
	x := 1
	y := 2

	z := switch {
		x < y { 10 }
		_     { 20 }
	}

	assert z == 10
}
This is currently not supported by the Q compiler but it shouldn't lead to a compiler panic: ``` main() { x := 1 y := 2 z := switch { x < y { 10 } _ { 20 } } assert z == 10 } ```
ed self-assigned this 2026-08-26 13:51:09 +00:00
Author
Owner

Fixed in 12612b1d56.

Fixed in https://git.urbach.dev/cli/q/commit/12612b1d568ae075fbd2c42b1854816c2575c456.
ed added spent time 2026-09-01 13:06:43 +00:00
30 minutes
ed closed this issue 2026-09-01 13:06:51 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Total time spent: 30 minutes
ed
30 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cli/q#45
No description provided.