Skip to content

Commit bf5c891

Browse files
danakjjonmeow
andauthored
Explain BoundMethod and function_id a bit more (#4739)
Co-authored-by: Jon Ross-Perkins <[email protected]>
1 parent f6d0cda commit bf5c891

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

toolchain/sem_ir/typed_insts.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,9 @@ struct BoolLiteral {
384384
BoolValue value;
385385
};
386386

387-
// A bound method, that combines a function with the value to use for its
388-
// `self` parameter, such as `object.MethodName`.
387+
// For member access such as `object.MethodName`, combines a member function
388+
// with the value to use for `self`. This is a callable structure; `Call` will
389+
// handle the argument assignment.
389390
struct BoundMethod {
390391
static constexpr auto Kind = InstKind::BoundMethod.Define<Parse::NodeId>(
391392
{.ir_name = "bound_method",
@@ -396,6 +397,7 @@ struct BoundMethod {
396397
// `self`, or whose address will be used to initialize `self` for an `addr
397398
// self` parameter.
398399
InstId object_id;
400+
// The function being bound, whose type_id is always a `FunctionType`.
399401
InstId function_id;
400402
};
401403

0 commit comments

Comments
 (0)