tracker issue : CF-4198399

select a category, or use search below
(searches all categories and all time range)

Chaining Elvis operators fails in ACF11

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Samuel Knowlton / Samuel Knowlton ()

Created: 03/13/2017

Components: Language

Versions: 11.0

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 11,0,11,301867 / 2018,0,0,308513

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 10 64 bit

Vote Count: 3

Problem Description: Using more than one elvis operator in a statement with a failsafe option produces UNDEFINED rather than the failsafe option. This works correctly in ACF11.

Steps to Reproduce:

(code snippets courtesy of @adam_cameron and @ryanguill - uncomment a, b, or c, but the snippet as-is will produce the buggy result)

//a = "eh?";
//b = "be!";
//c = "see?";

//foo = (a ?: b) ?: c;
foo = a ?: (b ?: (c ?: "failsafe"));



Actual Result: Variable FOO is UNDEFINED

Expected Result: "failsafe"

Any Workarounds:



sorry, that should read 'works correctly in ACF 2016' - it does not work correctly in ACF11.
Comment by Samuel K.
1106 | March 13, 2017 03:50:22 PM GMT
CF11 is still supported, so it this should work in CF11.
Vote by Adam C.
1108 | March 13, 2017 03:52:05 PM GMT
This will be fixed in the Aether release. We can evaluate if the fix can be made available in 2016 but this fix cannot be made for v11.0 since the implementation underwent a major change in the 2016 release and would result in several backward-compatibility issues.
Comment by Vamseekrishna N.
1107 | September 14, 2017 04:18:47 PM GMT
Vamseekrishna then remove it from acf11. You have a half made feature that just confuses and breaks code. In all reality the elvis operator does NOT work in acf11 in almost every scenario. This is dissapointing and just plain lame. If people are PAYING for the language feature, then fix it or remove it.
Comment by Luis M.
30592 | March 29, 2019 06:01:41 PM GMT