rokucommunity / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
4 stars 2 forks source link

Side effect issue with Optional Chaining implementation #30

Closed lvcabral closed 7 months ago

lvcabral commented 8 months ago

After the PR #21 the code below stopped working, the ? on a single line if with no then

function testOneLineIf()
    testA = ["apple", 2, "banana", "orange", 5, "grape", "pear"]
    for fruit = 0 to testA.count()-1
        if type(testA[fruit]).inStr(0,"String") >=0 ? testA[fruit]
        ? "item="+testA[fruit].toStr()+" index="+fruit.toStr()
    next
end function

Now this give an error: Expected statement or function call, but received an expression