Skip to content

Implement opUDAOn and opChildOfUDAOn#22915

Draft
rikkimax wants to merge 1 commit intodlang:masterfrom
rikkimax:opUDAOn
Draft

Implement opUDAOn and opChildOfUDAOn#22915
rikkimax wants to merge 1 commit intodlang:masterfrom
rikkimax:opUDAOn

Conversation

@rikkimax
Copy link
Copy Markdown
Contributor

Is part of linker list work #22824.

Requires DIP.

@rikkimax rikkimax added the Review:Needs Spec PR A PR updating the language specification needs to be submitted to dlang.org label Apr 13, 2026
@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request and interest in making D better, @rikkimax! 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#22915"

@nordlow
Copy link
Copy Markdown
Contributor

nordlow commented Apr 13, 2026

What are the use case(s) for this other than

struct UDA {
    void opUDAOn(alias symbol)() {
        pragma(msg, "On: " ~ __traits(identifier, symbol));
    }

    void opChildOfUDAOn(alias symbol)() {
        pragma(msg, "Child: " ~ __traits(identifier, symbol));
    }
}

?

@rikkimax
Copy link
Copy Markdown
Contributor Author

What are the use case(s) for this other than

struct UDA {
    void opUDAOn(alias symbol)() {
        pragma(msg, "On: " ~ __traits(identifier, symbol));
    }

    void opChildOfUDAOn(alias symbol)() {
        pragma(msg, "Child: " ~ __traits(identifier, symbol));
    }
}

?

This doesn't seem like a complete question.

The purpose of these two operator overloads is to allow triggering of reflection capabilities that are then registered somewhere.

Such as with web routing or deserialization.

adamdruppe added a commit to opendlang/opend that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review:Needs Spec PR A PR updating the language specification needs to be submitted to dlang.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants