Skip to content

0.720

Choose a tag to compare

@github-actions github-actions released this 09 May 04:59
· 61 commits to main since this release

LuauCeption Release

Updated to Luau version 0.720.

Luau Upstream Release Notes

Howdy there, folks! We've got another Luau release this week, mainly focused on some pain points with type analysis!

Note: For folks who are using definition files for providing type definitions for the runtime environment they're working in, we also wanted to highlight that the declare class syntax is being entirely cleaned up finally. We added syntax for declare extern type many months ago, and with the Luau classes RFC accepted, it is particularly prudent that we finalize the cleanup of declare class. If you're still on the old syntax, please update to use declare extern type Foo with ... to avoid interruption when a future release removes declare class entirely.

Language

  • The const keyword now correctly appears in autocomplete suggestions from Luau.

Analysis

  • Fixes false positive OptionalValueAccess errors when iterating over a table with an optional indexer type. The VM's generalized iteration already guarantees non-nil values in the loop body, and the type checker now reflects that. Fixes luau-lang/luau#2236.
--!strict
type TypeA = { Value: any }
local list = {} :: { [string]: TypeA? }

for index, a in list do
    a.Value = 1 -- No longer incorrectly reported as 'TypeA?' could be nil
end
  • Improves bidirectional type inference for unions of tables and functions. Table literals that clearly match one branch of a union are no longer falsely rejected:
--!strict
type FnRecord = { handler: (number) -> string, label: string? }
type StrRecord = { handler: string, label: string? }
type Record = FnRecord | StrRecord

-- Previously flagged as not a subtype of `Record`; now correctly accepted as a FnRecord
local r: Record = {
    handler = function(input)
        return tostring(input)
    end,
    label = "test",
}
  • Fixes a crash that could occur when typeof is used inside the type arguments of an instantiated method call:
local t = {}
function t:f<T>() end
local x = 42
t:f<<typeof(x)>>() -- No longer crashes
  • Fixes missing autocomplete suggestions for string singleton types when the expected type is an intersection containing a string singleton (e.g. "Foo" & "Foo" or keyof<typeof(tbl)> & T).

Compiler

  • Fixes a discrepancy where string interpolation would sometimes emit a redundant MOVE instruction that an equivalent string.format call would not, when the target register was already correct. (#2324 from @9382, thanks!)

Internal Contributors

Co-authored-by: Andy Friesen afriesen@roblox.com
Co-authored-by: Annie Tang annietang@roblox.com
Co-authored-by: Hunter Goldstein hgoldstein@roblox.com
Co-authored-by: Thomas Schollenberger tschollenberger@roblox.com
Co-authored-by: Varun Saini vsaini@roblox.com
Co-authored-by: Vighnesh Vijay vvijay@roblox.com
Co-authored-by: Vyacheslav Egorov vegorov@roblox.com