Skip to content

Commit

Permalink
Explain BoundMethod and function_id a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
danakj committed Dec 23, 2024
1 parent 28602a8 commit 75e8e04
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions toolchain/sem_ir/typed_insts.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,10 @@ struct BoolLiteral {
BoolValue value;
};

// A bound method, that combines a function with the value to use for its
// `self` parameter, such as `object.MethodName`.
// A bound method, that combines a function with the value to use for its `self`
// parameter, such as `object.MethodName`. It is a callable thing like the
// `FunctionType` it refers to through the type of the `function_id`
// instruction, rather than a call to the method itself like `Call`.
struct BoundMethod {
static constexpr auto Kind = InstKind::BoundMethod.Define<Parse::NodeId>(
{.ir_name = "bound_method",
Expand Down

0 comments on commit 75e8e04

Please sign in to comment.