-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to perform reflection on function parameters #21453
Comments
This comment was marked as resolved.
This comment was marked as resolved.
I see how that would be the case for implementing this via |
Ah, my bad, it seems I didn't properly read that line. |
For certain use cases in might be, but this adds a lot of complexity
Yes I agree, needing to reparse your source code in order to do reflection is not an ideal interface. If the compiler has this information already - why not provide in comptime and save the trouble? |
It is possible to reflect on the types of functions but not their names using
@typeInfo(function).Fn.params
. It would be useful if we had some way of accessing the names of these parameters as well, such as@paramInfo(function)
The specific use case for parameter name reflection is generating luadoc comments from zig functions. See natecraddock/ziglua#94
The ability to perform compile time reflection on parameter names would probably also be useful for any other projects that are generating cross-language bindings or documentation
The text was updated successfully, but these errors were encountered: