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

Error in tàbí ṣé conditionals #38

Closed
mykeels opened this issue Dec 12, 2018 · 2 comments
Closed

Error in tàbí ṣé conditionals #38

mykeels opened this issue Dec 12, 2018 · 2 comments

Comments

@mykeels
Copy link
Contributor

mykeels commented Dec 12, 2018

Describe the bug

I tried writing the following function:

ise muIseju(iseju) {
    ṣé (iseju > 30) {
        pada BEFOREPOINTER + muNọmbaWa(60 - iseju);
    }
    tàbí ṣé (iseju < 30) {
        pada AFTERPOINTER + muNọmbaWa(iseju);
    }
    tàbí {
        pada aabo;
    }
}

There's already an imported constants.yl file with a function definition for muNọmbaWa, and variable declarations for BEFOREPOINTER, AFTERPOINTER and aabo.

To Reproduce
Steps to reproduce the behavior:

  1. When I supply 22 as an argument, I get undefined as its return value, but 32 as an argument returns Ku iseju Mejidinlogbon which is fine.

  2. If I flip the logic, and specify < before >, then 22 works and 32 does not.

  3. If I rewrite as nested if-else statements, then it works well.

    ṣé (iseju < 30) {
        pada AFTERPOINTER + muNọmbaWa(iseju);
    }
    tàbí {
        ṣé (iseju > 30) {
            pada BEFOREPOINTER + muNọmbaWa(60 - iseju);
        }
        tàbí {
            pada aabo;
        }
    }

Expected behavior
ṣé and tàbí ṣé should work.

@anoniscoding
Copy link
Owner

anoniscoding commented Dec 12, 2018

Thank you very much for pointing this out, i've found the bug. Nice eyes bro, more catches in the future. I will be making a PR to close this issue

@anoniscoding
Copy link
Owner

So i've fixed the bug. The fix is in version 1.0.9 on yorlang npm. Once again, thank you

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

2 participants