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

Add type assertion to _kwarg function return #32

Merged
merged 1 commit into from
Mar 1, 2023
Merged

Add type assertion to _kwarg function return #32

merged 1 commit into from
Mar 1, 2023

Conversation

eliascarv
Copy link
Owner

@eliascarv eliascarv commented Mar 1, 2023

On the main branch, this expression does not throw an error:

julia> @truthtable p & (~q | r) full=1
TruthTable
┌───────┬───────┬───────┬───────┬────────┬──────────────┐
│   p   │   q   │   r   │  ¬q   │ ¬q  r │ p  (¬q  r) │
├───────┼───────┼───────┼───────┼────────┼──────────────┤
│ truetruetruefalsetruetrue         │
│          │
│ falsefalsefalsetruetruefalse        │
└───────┴───────┴───────┴───────┴────────┴──────────────┘
                                           6 rows omitted

This PR solve this issue by adding a type assertion to _kwarg function return:

julia> @truthtable p & (~q | r) full=1
ERROR: TypeError: non-boolean (Int64) used in boolean context
Stacktrace:
  [1] _kwarg(expr::Expr)
...

@eliascarv eliascarv merged commit 5b5bb38 into main Mar 1, 2023
@eliascarv eliascarv deleted the kwarg branch March 1, 2023 01:19
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

Successfully merging this pull request may close these issues.

1 participant