Skip to main content

check_operator_method

Function check_operator_method 

Source
pub fn check_operator_method(
    mangled: &str,
    args: &[(SmolStr, Option<TypeExpr>)],
    name_span: Span,
    file_idx: u16,
    sources: &[Source],
)
Expand description

Checks a method named by an operator symbol where it is declared.

mangled carries both halves of the declaration, the type the impl block names and the operator, so one call covers the whole rule: the built-in types settle their own operators and take none, an operator takes exactly the operands it has, and the first parameter is the receiver. A method named with an identifier passes straight through.