Skip to content
Playground(another site)

bynk.resolve.method_unknown_type

Error A method is defined on an unknown type.

A method is declared on a type, as in fn Order.total(self), and the type has to be declared in the same unit, so that every value of it can reach the method. A misspelt or missing type is the usual cause. Correct the name, or declare the type next to the method.

Example

fn Order.total(self) -> Int { 1 } // ✗ there is no type `Order` here
type Order = { id: Int }
fn Order.total(self) -> Int { self.id } // ✓ `Order` is declared in this unit

In the Book

See also

  • Every code in its category, Resolution, on the diagnostic index.
  • bynk explain bynk.resolve.method_unknown_type shows the same from the installed toolchain, without a network.