Skip to content

Add back closure support #209

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

Merged
merged 5 commits into from
Jan 24, 2025

Conversation

PhilippMDoerner
Copy link
Collaborator

Adds back closure support that was originally removed by this commit: 7f766e4

The "proc" annotation to the parameter type is required for this to support closures. If it isn't there, you only support essentially proc() = discard

moigagoo and others added 5 commits December 25, 2024 23:10
This implicitly adds the "closure" pragma back to the proc.
This way, getDbProc is allowed to be a closure, which it typically has to be.
getDb so far has been {.nimcall.} while normal users are likely to define getDb procs as {.closure.}.

You can try to fix this error by allowing both with a generic, but that somehow causes
nim to run into ambiguous call errors as suddenly both the newPool
proc for postgres.DbConn and for sqlite.DbConn match one another.

To fix this we just enforce everything being a closure.
@moigagoo
Copy link
Owner

@PhilippMDoerner thanks for the fix!

@moigagoo moigagoo merged commit 96e0bde into moigagoo:develop Jan 24, 2025
10 checks passed
@PhilippMDoerner PhilippMDoerner deleted the add-back-closure-support branch January 24, 2025 20:18
@PhilippMDoerner
Copy link
Collaborator Author

PhilippMDoerner commented Jan 24, 2025

I noticed it for the most part because I updated my backend projectand suddenly my compilation broke completely 😄

@moigagoo
Copy link
Owner

@PhilippMDoerner sorry for the trouble. I've noticed that the tests stopped passing with Nim 2.2.0 and fixed them 😅.

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