Skip to content

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Oct 3, 2025

Summary

Fix an internal issue with type-bound operator lifting for closure
types.

Details

Instead of a proper isNil check, generation of the "not nil" check
for
closure environments used the pointer expression itself as the
condition expression of an if.

Since the expression was translated as is and a pointer value is valid
in an if condition position in C, this worked, but it's not correct
according to NimSkull's type system. A proper "not nil" check is
generated now.

@zerbina zerbina added bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler labels Oct 3, 2025
@zerbina
Copy link
Collaborator Author

zerbina commented Oct 4, 2025

/merge

Copy link

github-actions bot commented Oct 4, 2025

Merge requested by: @zerbina

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


Notes for Reviewers

@chore-runner chore-runner bot added this pull request to the merge queue Oct 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 4, 2025
@saem
Copy link
Collaborator

saem commented Oct 4, 2025

/merge

@chore-runner chore-runner bot added this pull request to the merge queue Oct 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 4, 2025
@zerbina zerbina added this pull request to the merge queue Oct 5, 2025
Merged via the queue into nim-works:devel with commit 5a14e3e Oct 5, 2025
43 checks passed
@zerbina zerbina deleted the liftdestructors-gen-proper-nil-check branch October 5, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants