Skip to main content

Module builtin_methods

Module builtin_methods 

Source
Expand description

The single owner of builtin value methods.

BUILTIN_METHODS names every method a builtin receiver supports, with its signature, whether it mutates its receiver, and its reference doc. REMOVED_METHODS records retired spellings and how to repair them. The VM and portable-kernel dispatch tables are drift-checked against these rows, and the typechecker, linter, language server, and generated docs derive from them.

Structs§

MethodDescriptor
One builtin value method: the single owner of its name, signature, effect, and reference documentation.
RemovedMethod
A method spelling that no longer exists on a receiver.

Enums§

MethodEffect
Whether calling the method changes its receiver.
MethodMigration
How source written against a removed method spelling is repaired.
MethodReceiver
The builtin value kind a method is dispatched on.

Constants§

COPY_COUNTERPARTS
Mutating list methods and the copy-returning method that computes the same result as a new value.
REFERENCE_BEGIN_MARKER
REFERENCE_END_MARKER

Statics§

BUILTIN_METHODS
REMOVED_METHODS

Functions§

copy_counterpart
The copy-returning counterpart of a mutating method (sorted for sort).
in_place_counterpart
The mutating counterpart of a copy-returning method (sort for sorted).
is_method_name
True when some builtin receiver has a method called name.
is_mutable_place
A place a mutating method can rewrite: a binding, or a property or subscript path rooted at one.
is_mutating_method_name
True when some builtin receiver has a mutating method called name.
is_pure_on_every_receiver
True when some builtin receiver has a pure method called name and no receiver has a mutating method of that name, so discarding the call’s result can never be intended.
method
The method name on receiver, if it exists.
method_names
Method names on receiver, in table order.
methods_of
Every method on receiver, in table order.
mutating_call_place
When node is place.method(...) naming a mutating builtin method, the receiver place it may rewrite. This is syntactic: a user struct method that happens to share the name also reports its receiver, which keeps write analyses conservative.
place_root
The binding at the root of a place expression.
removed_method
The retired spelling name on receiver, if it was removed.
removed_method_on_any_receiver
Every removed row for a retired spelling that no live method on any receiver still uses, so a call to it is stale whatever the receiver’s type. count is not one (iterators keep it); to_lower is. Empty otherwise.
render_reference
Markdown tables for every builtin receiver, without the region markers.
returns_generic
True when the method’s result type mentions one of its generic parameters, so the result depends on the receiver or the arguments.
splice_reference
Replace the generated region of document with a fresh rendering. None when the document lacks the markers.