left operand of the Elvis operator has to be a variable or a function

Description

This code runs without error on Adobe CF but fails on Lucee:

Error:

Even if it's just an example, elvis should accept any valid CFML expression on the left hand side.

Activity

Adam Cameron 12 November 2024 at 11:24

This should probs be a bug rather than an “incompatibility”, yeah? Its implementation is - objectively - broken, right?

Zac Spitzer 11 August 2021 at 06:58

Adam Cameron 10 August 2021 at 16:56

I just ran into this. This is reproduced from Slack:

 

Next one. This seems a bit contrived, but it's a distillation down from a more complicated & not-contrived situation.

The left operand should just be any expression that can evaluate to a boolean. It shouldn't matter if it's function call or a variable. It boggles my mind that there is code somewhere in Lucee that is written this way! Reminder:

However that error message is ballocks anyhow, as demonstrated here:

Sigh.

Pothys - MitrahSoft 16 March 2020 at 15:08

I've checked this ticket & also confirmed the issue reproduced on lucee while we didn't put any value in the left operand of this operator. It throws an error "left operand of the Elvis operator has to be a variable or a function call". Micha will confirm about this issue.

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Priority

Created 31 January 2020 at 20:34
Updated 6 March 2025 at 11:34