Struct

class Struct(    val name: Identifier,     val fields: Array<StructField>,     val methods: Array<StructMethod>) : Statement

Represents a structure type.

A struct can be referenced as a type annotation by the identifier at which it is accessible the current scope. Structs can define mutable fields and methods which can be accessed and called only on an instance of the struct.

Constructors

Link copied to clipboard
fun Struct(    name: Identifier,     fields: Array<StructField>,     methods: Array<StructMethod>)

Properties

Link copied to clipboard
val fields: Array<StructField>

an array of fields that exist on this struct.

Link copied to clipboard
val methods: Array<StructMethod>

an array of methods that exist on this struct.

Link copied to clipboard
val name: Identifier

the identifier that can be used to access this struct.