-
Notifications
You must be signed in to change notification settings - Fork 1.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
Explain BoundMethod and function_id a bit more #4739
base: trunk
Are you sure you want to change the base?
Conversation
Co-authored-by: Jon Ross-Perkins <[email protected]>
// The instruction from which to find the function being bound to an object. | ||
// The actual function (e.g. FunctionType) comes from the this instruction's | ||
// type id. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at member_access.cpp
, BoundMethod
will only be created for FunctionType
. I'm not sure I'd call that "the actual function"; to me, that's either the ID here, or the Function
object which contains the function implementation. That is, we're not using this to find the bound function, it is the bound function.
What do you think of:
// The instruction from which to find the function being bound to an object. | |
// The actual function (e.g. FunctionType) comes from the this instruction's | |
// type id. | |
// The function being bound, whose type_id is always a `FunctionType`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sidenote, I think this could maybe be renamed to function_decl_id
if you care -- we typically use function_id
for FunctionId
, but that's not the case here. I do think though that this will match the decl concept (although it may be an ImportRef
instead of a FunctionDecl
sometimes, I think that matches decl concept for me? I'm not strictly verifying the types either)
No description provided.