Skip to content

Fix #11004: preserve D-style variadics in SetFunctionAttributes#11062

Open
AayushMainali-Github wants to merge 2 commits into
dlang:masterfrom
AayushMainali-Github:fix-11004-setfunctionattributes-variadic
Open

Fix #11004: preserve D-style variadics in SetFunctionAttributes#11062
AayushMainali-Github wants to merge 2 commits into
dlang:masterfrom
AayushMainali-Github:fix-11004-setfunctionattributes-variadic

Conversation

@AayushMainali-Github

Copy link
Copy Markdown

Rationale

SetFunctionAttributes rebuilt D-style variadic function types by appending "..." after Parameters!T with no comma. For a function like void fn(int a, ...), that produced void function(int...) (typesafe variadic) instead of void function(int, ...) (D-style variadic).

The mixin now emits ", ..." when there are fixed parameters, and "..." when there are none. Regression coverage was added for D-style variadics with and without fixed parameters, and typesafe variadics are still preserved.

Verified locally with make -f posix.mak BUILD=debug std/traits.test (1 modules passed unittests), and with a direct compile of the issue repro (fails before the fix, passes after).

Feature request or issue tracking

Closes #11004.

Pre-review checklist

  • I have performed a self-review of my code.
  • If my PR fixes a bug or introduces a new feature, I have added thorough tests.
  • If my changes are non-trivial and do not concern a reported issue, I have added a changelog entry.

LLM/AI disclosure

This PR was written with the assistance of an LLM/AI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[std.traits] SetFunctionAttributes converts Varadic.d functions to Varadic.typesafe functions

2 participants