tracker issue : CF-4204105

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

Ternary Operator can't use decimals in set values

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Daniel H. / ()

Created: 03/17/2019

Components: Language, Expressions

Versions: 2018

Failure Type: Others

Found In Build/Fixed In Build: 2018.0.03.314033 /

Priority/Frequency: Normal /

Locale/System: / Win 2012 Server x64

Vote Count: 0

Problem Description:
If a ternary operation sets the true or false value to a number with a decimal (100.00), you'll get a compliation error

Steps to Reproduce:
Run below code in a CFM template (bug occurs in CFCs as well), comment out the testVar set in won't compile, and the error goes away.
<cfscript>
	testvar = "";
	//Won't Compile
	testVar = ((true) ? 100.5 : 60.5)
	writeDump(testVar);
	//Will Compile
	testVar = ((true) ? 100 : 60)
	writeDump(testVar);
	//Will Compile
	number100 = 100.5;
	number60 = 60.5;
	testVar = ((true) ? number100 : number60)
	writeDump(testVar);
</cfscript>


Actual Result:
Message: (class: cfterinaryTest2ecfm1709137711, method: runPage signature: ()Ljava/lang/Object;) Unable to pop operand off an empty stack
	StackTrace: java.lang.VerifyError: (class: cfterinaryTest2ecfm1709137711, method: runPage signature: ()Ljava/lang/Object;) Unable to pop operand off an empty stack
Expected Result:
Template should compile and writedump 100.5, 100, and then 100.5 again.

Any Workarounds:
You can set the true/false values in variables above to the decimal versions of the numbers you need.

Attachments:

Comments:

Duplicate Bug ID : CF-4203996
Comment by Suchika S.
30560 | March 22, 2019 11:12:40 AM GMT