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

type inference issue #674

Closed
orefalo opened this issue Aug 3, 2023 · 3 comments
Closed

type inference issue #674

orefalo opened this issue Aug 3, 2023 · 3 comments
Labels
bug Unexpected behavior

Comments

@orefalo
Copy link
Contributor

orefalo commented Aug 3, 2023

Describe the bug:

murex-utils » a=33
murex-utils » echo $a
33
murex-utils » round ${$a * $a} 1
Error in `expr` (0,2): cannot Multiply non-numeric data types
                     > Expression: $a * $a
                     >           :    ^
                     > Character : 4
                     > Symbol    : Multiply
                     > Value     : ''

Expected behaviour:
It looks like a=33 is infered to be a string,
I would expect 1089 as an output

@orefalo orefalo added the bug Unexpected behavior label Aug 3, 2023
lmorg added a commit that referenced this issue Aug 4, 2023
@lmorg
Copy link
Owner

lmorg commented Aug 4, 2023

Coincidentally this is down the the double parsing we chatted about earlier. The expression pre-parser doesn't expand variables (for speed) but I'd forgotten to add a check that variables are valid values.

Fix pushed to develop

@lmorg
Copy link
Owner

lmorg commented Aug 4, 2023

(I’m actually a little annoyed at myself for not having this covered in a test)

@orefalo
Copy link
Contributor Author

orefalo commented Aug 4, 2023

fixed, ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior
Projects
None yet
Development

No branches or pull requests

2 participants