View Issue Details

Category
整備班:YAYA
SeveritymajorReproducibilityalways 
Status closed 
Fixed in Version2.5 (リリース) 
Summary0000211: Returning local arrays in recursive functions no longer works in the latest versions of YAYA
DescriptionI ran into something very strange when setting up a recursive function. If I have a recursive function create a local array, recursive calls will not return the local array, and will simply return an empty string. If I convert the local array to a string before returning it, then it works fine. I tested this same code in an older version of YAYA and returning a local array worked perfectly fine. (I'm not sure what version... is there a way to tell? It was definitely from before the changes made to STRENCODE recently)

Here's the code I'm using to test. This function doesn't do anything in particular, it's only for testing purposes.

StartRecursive
{
    Recursive = 0
    RecursiveTest('One','Two','Three')
    ERASEVAR("Recursive")
}

RecursiveTest
{
    _array = IARRAY
    _recursive = IARRAY
    foreach _argv; _arg
    {
        Recursive++
        _array ,= _arg
    }
    if Recursive < 10
    {
        LOGGING("===START RECURSIVE FUNCTION===")
        _recursive = RecursiveTest(_argv)
        LOGGING("===RECURSION DONE, GOT %(_recursive)===")
        _array ,= _recursive
    }
    LOGGING("Returning: %(_array)")
    _array
}


On the latest versions of YAYA, you'll see output like this:

"===START RECURSIVE FUNCTION==="
"Returning: One,Two,Three"
"===RECURSION DONE, GOT ==="


Whereas on older versions, you'll see the intended output:

"===START RECURSIVE FUNCTION==="
"Returning: One,Two,Three"
"===RECURSION DONE, GOT One,Two,Three==="
TagsNo tags attached.
Attach Tags

Activities

ponapalt

2021-07-16 16:16

administrator   ~0000470

Tc559-1 Fixed

Issue History

Date Modified Username Field Change
2021-07-10 15:17 guest New Issue
2021-07-16 16:16 ponapalt Assigned To => ponapalt
2021-07-16 16:16 ponapalt Status new => closed
2021-07-16 16:16 ponapalt Resolution open => fixed
2021-07-16 16:16 ponapalt Note Added: 0000470
2021-08-13 17:27 ponapalt Fixed in Version => 2.5 (リリース)