nim-works / nimskull

An in development statically typed systems programming language; with sustainability at its core. We, the community of users, maintain it.
https://nim-works.github.io/nimskull/index.html
Other
279 stars 39 forks source link

fix C compilation errors with closures and nested types #1397

Closed zerbina closed 3 months ago

zerbina commented 3 months ago

Summary

Fix a bug with hook synthesis that led to C compiler errors when using some closure procedures or refs of non-top-level object type.

Details

Multiple same-shaped anonymous/non-top-level object types are not merged into a single one by the C code generator, which due to all sharing the same set of hook procedures, resulted in C compiler errors due to implicit conversions between incompatible pointer types.

saem commented 3 months ago

/merge

github-actions[bot] commented 3 months ago

Merge requested by: @saem

Contents after the first section break of the PR description has been removed and preserved below:


## Notes for Reviewers * a latent issue that was surfaced by #1382 * I've built the tests locally with `-Werror=incompatible-pointer-types` enabled to make sure they compile