Repository navigation
0.721
LuauCeption Release
Updated to Luau version 0.721.
Luau Upstream Release Notes
Language
- Add support for read-only indexers using the syntax
{read T}or{read [K]: V}. Read-only indexers are really useful for functions that accept an array, but don't modify it because calls to such a function can be tested covariantly rather than invariantly:
function print_them_old(a: {Instance}) ... end
function print_them_new(a: {read Instance}) ... end
local players: {Players} = ...
-- We have to reject this call because, for all we know, the
-- function could insert non-Players into our Player array!
print_them_old(players)
-- This function is not allowed to write to the array so
-- everything is fine.
print_them_new(players)- Fix a unification bug that would result in incorrect inference in cases like
'a <: T | nilwhere'ais a free type andTis an instantiated generic. This would result in incorrect inferences in cases like the following:
local function f<T>(a: T & string): T
return a
end
local b = f("hello")
local c = f(("world" :: string))- First steps toward implementing classes. See the RFC for details.
Analysis
-
Ensure that inferred arguments to functions are instantiated. This fixes a class of bugs that could cause type inference to hang and consume lots of memory.
-
Improve the error that's reported when two table types are only incompatible because of a read/write restriction. This fixes cases where we would report nonsense errors like "number is not a subtype of number."
-
We had an issue where passing a function type through a type function would cause type inference to discard the data about the parameters' names even if the type was returned verbatim. This is now fixed.
Interpreter
- Adjust the FASTCALL3 inlining cost model to line up with other fastcalls.
- Reduce Luau VM interpreter loop stack pressure in Debug/NoOpt builds
- Optimize the constant folding pass in the compiler
Native Code Generation
- Introduce ExitSync blocks to help avoid synchronizing the VM stack unnecessarily.
- NCG VM exit sync cannot include register from blocks not in a chain.
- Add CALLFB instruction and feedback vectors in proto. This will be used to help the runtime know which function calls can be inlined.
- Handle repeated IrCmd::LOAD_ENV and switch from table RegisterLink information to SSA info.
General
- You can now pass
--solver=newor--solver=oldtoluau-analyzetool to select the solver you'd like to use. It defaults to the new solver.
Internal Contributors
Co-authored-by: Andy Friesen afriesen@roblox.com
Co-authored-by: Annie Tang annietang@roblox.com
Co-authored-by: Ariel Weiss arielweiss@roblox.com
Co-authored-by: Hunter Goldstein hgoldstein@roblox.com
Co-authored-by: Ilya Rezvov irezvov@roblox.com
Co-authored-by: Sora Kanosue skanosue@roblox.com
Co-authored-by: Vighnesh Vijay vvijay@roblox.com
Co-authored-by: Vyacheslav Egorov vegorov@roblox.com