Xo is experimental. The source code is not public yet; it will be soon. Read the release notes
Menu · XO0174

Docs

XO0174: bare `self` parameter outside an interface method signature

error · reported by the parser

A bare self parameter is only allowed first in an interface method signature (fn get(self, id: Int) -> T?). A method on a concrete type names its receiver before the method name: fn (p: Point) norm() -> Int. See core 2.4 and 3.4.

Example

struct P { x: Int }

fn norm(self, scale: Int) -> Int { scale }

Fix

struct P { x: Int }

fn (p: P) norm(scale: Int) -> Int { p.x * scale }

Run xo explain XO0174 for this text in a terminal, or see section 10.6 of the specification.