If-then-else expressions inside of interpolated strings makes script editor expect additional 'end'

Interpolated strings with if-then-else expressions make the script editor think an additional ‘end’ is necessary.

I expect the script editor to know an additional end is not expected and not add an additional end.

Where it happens: Studio only, any game.

When it happens: First noticed it January 10 2023 at ~3:42 PM AST

Repro instructions:
1- Paste the following in the script editor:

local a = `{ if true then 'a' else 'b' }`

2- Press enter.

Video demo:

3 Likes

We’ve filled a ticket into our internal database for this issue, and will come back as soon as we have updates!

Thanks for flagging!

2 Likes

@Focia19,

I’m not sure if I should make a separate bug report as unsure whether or not they’re related, but it also seems to happen with nested if-then-else expressions as well, so:

local a = if true then if true then 'a' else 'b' else 'c'

will give you the same behaviour of the script editor expecting the redundant end

1 Like

This seems to have been fixed after the first Studio update following the release of interpolated strings

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.