Skip to content

Multiline ternary expression fails syntax check #2223

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

Open
thePHTest opened this issue Dec 1, 2022 · 0 comments
Open

Multiline ternary expression fails syntax check #2223

thePHTest opened this issue Dec 1, 2022 · 0 comments
Labels

Comments

@thePHTest
Copy link
Contributor

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating System & Odin Version:
  • Please paste odin report output:
    Odin: dev-2022-11:6fa0679b
    OS: Windows 11 Home Basic (version: 21H2), build 22000.1219
    CPU: 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
    RAM: 32602 MiB

Expected Behavior

Compiles.

Current Behavior

Fails with syntax error.

Failure Information (for bugs)

These two multiline ternary expressions fail to compile:

	val := 1 \
		if true else 2
	val := 1 \
		if true \
		else 2

This one compiles and works:

	val := 1 if true \
		else 2

Failure Logs

Syntax Error: Expected '{', got 'else'
@github-actions github-actions bot added the stale label Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant