public / private / protected
Parsed and ignored. Luau has no access specifiers.
Syntax
Section titled “Syntax”struct S {public: int x;private: int y;};Parameters
Section titled “Parameters”None.
Return value
Section titled “Return value”None.
Luau emit
Section titled “Luau emit”(omitted)
Description
Section titled “Description”They exist so C++-looking headers parse. Encapsulation is by ModuleScript surface, not the compiler.
Example
Section titled “Example”struct S {public: int x;};Emits:
-- fields still emit on the type