kw operator
Reserved keyword
The list of words: §1.4
Syntax
Operator = "operator" OpSymbol [ Generics ] "(" Params ")" "->" Type
( ( "infixl" | "infixr" | "infix" ) IntLit | "prefix" ) ( Block | "=>" Expr ) ;Grammar: App. A
Defined in
- 5.3 Overloading and user-defined operators — Overloading built-in operators — op declarations in impl
- 1.4 Keywords — Reserved (cannot be used as names)
Examples
operator <|> <T>(a: Parser<T>, b: Parser<T>) -> Parser<T> infixl 3 => a.orElse(b)
operator ~~ (s: str, re: Regex) -> bool infix 4 => re.matches(s)
operator ^^ (a: f64, b: f64) -> f64 infixr 12 => a.pow(b)
operator ¬ (b: Bits) -> Bits prefix => b.invert()— 5.3 Overloading and user-defined operators
Related diagnostics
not-callable, not-overloadable, operator-decl, range-not-iterable