Skip to main content

Module method_registry

Module method_registry 

Source
Expand description

Canonical builtin-method name tables.

These lists mirror the method-dispatch match arms in the VM (crates/harn-vm/src/vm/methods/*.rs). They are the single source of truth the typechecker uses to decide whether a receiver.method() call names a method that actually exists on a concrete builtin receiver, so that "x".frobnicate() / (3.14).frobnicate() fail harn check instead of crashing (strings/lists/sets) or silently returning nil (numbers) at runtime.

Drift guard: a test in harn-vm (method_registry_matches_vm) asserts every name here is accepted by the corresponding VM dispatch, so a stale entry can never produce a false “unknown method”. When you add a method to a VM dispatch, add its name to the matching list below.

Constants§

DICT_METHODS
dict receiver methods (call_dict_method_sync + call_dict_method), plus .iter(). Dicts are not directly existence-checked (a dict may store a callable under a key and be invoked as d.field()), but their method names still belong to the recognized-method universe.
GENERATOR_METHODS
Generator / stream drive methods (call_generator_method).
ITER_METHODS
Iter<T> combinators and sinks (call_iter_method + the lazy-iter arms in infer_type). Part of the recognized-method universe.
LIST_METHODS
list receiver methods (call_list_method_sync + call_list_method), plus .iter().
RANGE_METHODS
range receiver methods (call_range_method_sync), plus .iter().
SET_METHODS
set receiver methods (call_set_method_sync + call_set_method), plus .iter().
STRING_METHODS
string receiver methods (call_string_method), plus the universal .iter() bridge that call_method_sync handles for every iterable.