Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/syntax-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Taking references to class methods via `ClassName.method` syntax is allowed so t
local n = pcall(SomeClass.getName, someClassInstance)
```

To construct an instance of a class, call the class object as though it were a function. It accepts a single argument: a table that contains initial values for all the fields.
To construct an instance of a class, call the class object as though it were a function. It accepts a single argument: a table-like value that contains initial values for all the fields. While it will typically be most useful to pass a table literal to this function, that isn't the only use. For example, any class can be shallowly cloned by passing it to its class constructor: `local clone = MyClass(original)`
Comment thread
andyfriesen marked this conversation as resolved.

The top type of all class objects is named `class`. `type()` and `typeof()` return `"class"` when passed a class object.

Expand Down