Mantis

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0027218RunnerGeneralPublic2017-07-28 09:392017-08-04 11:47
ReporterStewart Bishop 
Assigned ToMark Alexander 
PriorityLowSeverityC - GeneralReproducibility100%
StatusResolvedResolutionFixed 
PlatformOSOS Version
Summary0027218: General: Bug with nested ternary operator associativity
DescriptionCurrent behavior:
The first line of code works but the second one gives a compilation error.
The IDE does not throw any linter errors. (FINE)

Expected behavior:
Both lines should compile fine. The ternary operator (a ? b : c) has a bad associativity order.
Steps To ReproduceSteps to reproduce:
Copy this code in a new script:
var c = a ? "foo" : (b ? "bar" : "wii"); //FINE
var c = a ? "foo" : b ? "bar" : "wii"; //ERROR

Run project
1.4 Version
2.x Runtime Version2.0.7.110
2.x Runtime Version Verified In
Attached Files

- Relationships

-  Notes
(0054681)
Daniel Cleaton (Administrator)
2017-07-31 09:46

Will always need the brackets. Should update the manual to say this.
(0054691)
Piotr Gnys (Updater)
2017-07-31 13:24

Code editor could also mark this an error then.
(0054782)
Mark Alexander (Developer)
2017-08-04 11:47

Fixed.


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker