lloyAlloy on GitHub
impl
Docs

impl

Updated
impl Name ... end
impl Trait for Name ... end

Methods for a struct, an enum, or a foreign type such as Vector3 or string. A foreign impl needs export and works project wide. Its method replaces the type's own method of the same name: pos:flat() calls the impl when one names flat, and the type's own method only when none does. A unit enum is a string, so its methods are called on the enum: Status.describe(s).

Emits functions on the class table.

The word is also free as a name. impl declares only before a name on the same line, so local impl = 1 and t.impl read the Luau way.