Skip to content

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Oct 2, 2025

Summary

Fix an internal-only problem with sigmatch handling of named
parameters in conjunction with varargs.

Details

Unlike for unnamed parameters, the implicit array construction created
when using named parameters for passing a single value to a varargs
parameter was not wrapped in a to-varargs conversion, nor was the type
marked as being a varargs container (via the tfVarargs flag).

This caused no downstream issues so far, as all three code generators
handle the necessary run-time conversion themselves, but it's
still incorrect.

Summary
=======

Fix an internal-only problem with `sigmatch` handling of named
parameters in conjunction with `varargs`.

Details
=======

Unlike for unnamed parameters, the implicit array construction created
when using named parameters for passing a single value to a `varargs`
parameter was not wrapped in a to-varargs conversion, nor was the type
marked as being a varargs container (via the `tfVarargs` flag).

This caused no downstream issues so far, as all three code generators
handle the necessary run-time conversion themselves, but it's
still incorrect.
@zerbina zerbina added bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler labels Oct 2, 2025
Copy link
Collaborator

@saem saem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, I ran into this bug when reworking varargs/dispatch.

@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 bot pushed a commit that referenced this pull request Oct 4, 2025
## Summary

Fix an internal-only problem with `sigmatch` handling of named
parameters in conjunction with `varargs`.

## Details

Unlike for unnamed parameters, the implicit array construction created
when using named parameters for passing a single value to a `varargs`
parameter was not wrapped in a to-varargs conversion, nor was the type
marked as being a varargs container (via the `tfVarargs` flag).

This caused no downstream issues so far, as all three code generators
handle the necessary run-time conversion themselves, but it's
still incorrect.
@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 07959b7 Oct 5, 2025
43 checks passed
@zerbina zerbina deleted the sigmatch-fix-missing-varargs-conversion branch October 5, 2025 17:33
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