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

try? / else not working correctly with return statements #1294

Closed
drkameleon opened this issue Nov 6, 2023 · 2 comments
Closed

try? / else not working correctly with return statements #1294

drkameleon opened this issue Nov 6, 2023 · 2 comments
Assignees
Labels
bug Something isn't working critical Critical, top-priority issues

Comments

@drkameleon
Copy link
Collaborator

drkameleon commented Nov 6, 2023

Describe the bug

Probably related to: #1247 ?

To Reproduce

getCorrectVersion: function [versionString][
    try? [
        return to :version versionString
    ]
    else [
        try? [
            return to :version strip replace versionString "v" ""
        ]
        else [
            return null
        ]
    ]
]

getCorrectVersion "v0.9.83" ; returns `null`

This returns null no matter what.

However, this works:

getCorrectVersion: function [versionString][
    try? [
        to :version versionString
    ]
    else [
        try? [
            to :version strip replace versionString "v" ""
        ]
        else [
            null
        ]
    ]
]

getCorrectVersion "v0.9.83" ; returns `0.9.83` (:version)
@drkameleon drkameleon added bug Something isn't working critical Critical, top-priority issues labels Nov 6, 2023
@drkameleon drkameleon self-assigned this Nov 6, 2023
@RickBarretto
Copy link
Collaborator

RickBarretto commented Dec 8, 2023

Well, there is no try? anymore. @drkameleon

@RickBarretto
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical Critical, top-priority issues
Projects
Development

No branches or pull requests

2 participants