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

explicit converts bool types to int types for quoted variables #221

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

ringabout
Copy link
Contributor

@ringabout ringabout commented Feb 24, 2023

Here is the definition of parReq, which is an int type

parReq*: int        ## flag indicating parameter is mandatory

Here is the definition of isReq, which is a boolean type

let isReq = if i in mandatory: true else: false

In the quote block, isReq is assigned to the parReq field, which has incompatible types.

`apId`.parReq = `isReq`

It is not safe to rely on the type erasure at the compile time, which might be changed in the future => nim-lang/Nim#21433

@ringabout ringabout changed the title explicit convert bool types to int types for quoted variables explicit converts bool types to int types for quoted variables Feb 24, 2023
@c-blake c-blake merged commit f11ba13 into c-blake:master Feb 24, 2023
@c-blake
Copy link
Owner

c-blake commented Feb 24, 2023

Thank you!!

@ringabout ringabout deleted the patch-1 branch February 24, 2023 14:22
Gruruya pushed a commit to Gruruya/cligen that referenced this pull request Mar 2, 2023
taken from c-blake/cligen#221
fixes errors when building [disruptek/bump](https://github.com/disruptek/bump) with Nim >= 1.9.1
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.

2 participants