Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot decode nested lists of arbitrary depth #2

Closed
q9f opened this issue Jan 27, 2020 · 1 comment
Closed

Cannot decode nested lists of arbitrary depth #2

q9f opened this issue Jan 27, 2020 · 1 comment

Comments

@q9f
Copy link
Owner

q9f commented Jan 27, 2020

def foo(r : Number)
    if r === 0
        return ""
    elsif r === 1
        return [] of String
    elsif r === 2
        return Bytes[0x0]
    else
        bar = [] of (String | Bytes | Array(String | Bytes))
        return bar << foo Random.rand(3)
    end 
end

pp foo Random.rand(3)

ref crystal-lang/crystal#8719

@q9f
Copy link
Owner Author

q9f commented Jan 27, 2020

@q9f q9f closed this as completed in 4fd7b69 Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant