Skip to content

Extension#

Introduction#

Extensions allow you to add extra methods and functions to existing classes or structs. Fields cannot be added this way. Private members cannot be accessed by extensions.

Struct Foo
    Field i:Int = 0
End
Struct Foo Extension
    Method Increment()
        i += 1
    End
End