Skip to content

Conversation

@vindexbit
Copy link
Contributor

@vindexbit vindexbit commented Dec 26, 2025

Related issue: #19163

dmd sometimes lowered a delegate literal in a UDA (retrieved via __traits(getAttributes)) as only a function pointer (one word) and then assigned it into a delegate slot (two words).

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @vindexbit! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#22316"

Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

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

otherwise looks good

@NameAttribute({ return 42; }) int a;
}

void main()
Copy link
Contributor

Choose a reason for hiding this comment

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

compilable tests shouldn't have their test function be called main

@thewilsonator thewilsonator linked an issue Dec 27, 2025 that may be closed by this pull request
@vindexbit
Copy link
Contributor Author

This command shows a suspiciously large number of fails:
HOST_DMD=../../generated/linux/release/64/dmd ./run.d compilable

...
FAILED targets:
- compilable/issue15574.sh
- compilable/test14894.sh
- compilable/issue19243.sh
- compilable/issue19724.sh
- compilable/test6461.sh
- compilable/issue24830.sh

@thewilsonator thewilsonator merged commit e5fb952 into dlang:master Dec 27, 2025
42 checks passed
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.

ICE with delegate in UDA

3 participants