Marshal Overview — Default Rule Matrix
Normative: Default Marshal for each CLR type in C# ↔ Lua bidirectional calls when [LuaMarshalAs] is absent (or set to LuaMarshalType.Default).
`[LuaMarshalAs]` and `LuaMarshalType`
Normative: Marshal override rules on parameters, return values, fields, properties, and types (class / struct).
`ref` / `in` / `out` Marshal
Normative: Marshal semantics for byref parameters (element type A) in C# ↔ Lua bidirectional calls.
OpaqueValue (Temporary Opaque Parameter)
Normative: When C# calls Lua, a temporary token exposing a parameter/local storage address on the C# call stack to script; and the forced path via [LuaMarshalAs(OpaqueValue)].
Struct Marshal
Normative: Passing, construction, and write-back rules for C# structs (value types) with Lua.
Class / Interface Marshal
Normative: Default Marshal rules for reference types (class, interface, string, array instances, delegate instances, etc.) between Lua and C#.
Array Marshal
Normative: Marshal rules for one-dimensional vector arrays (szarray), multi-dimensional arrays (mdarray), and byte[] between Lua and C#.
Enum Marshal
Normative: Default Marshal rules for C# enum between Lua and C#.
Delegate / Function Marshal
Normative: Bidirectional Marshal between C# Delegate and Lua functions.
Pointers and Unsupported Types
Normative: Marshal rules for unmanaged pointers, function pointers, and CLR forms that are unsupported or restricted by default in v1.
Marshal Spec (`spec/marshal/`)
Normative: C# ↔ Lua value shapes on the stack and conversion rules.