0.690
New Type Solver
- Improve the error message for an uninstantiated type alias, as in:
type Packed<T...> = (T...) -> T...
local a: Packed -- Now has a single, specific, error- Improve refinements of extern types against table types, ensuring the extern part is dropped less often, as in:
local function update(foo: Instance)
assert(foo.Name == "bubbles")
-- Previously might have been `{ read Name: "bubbles" }`,
-- will now be `Instance & { read Name: "bubbles" }`
return foo
end- Resolve an internal complier exception when attempting to use
typeofinside the generic type default of an alias. Fixes #1462. - No longer throw an internal compiler exception for exceptionally large ASTs, though a
CodeTooComplexerror will still be raised. - Broadly rework generic pack subtyping to allow code like the following to type check without errors:
function f(foo: (number) -> number): () end
type T = <A...>(A...) -> number
local t: T
-- OK, as a function that takes some generic pack of arguments can receive a `number` as well.
f(t)- Report an error when a type pack is provided to a generic alias that can receive a type and a type pack, as in:
type Y<T = string, U... = ...string> = { a: (T) -> U... }
-- Now errors as you must provide a type before the pack.
local a: Y<...number>- Fix an instance of generics leaking when returning a function from another function with explicitly defined generics. Fixes #1971.
- Cache
HasPropConstraints such that for every pair of subject type and desired property, we only emit a single constraint and blocked type; this incidentally fixes some bugs around inferring the types of properties onself. - Table types associated with table literals are now tracked specially to make type checking more permissive, such as in:
type Foo = { name: string?, flag: boolean? }
local arr: {Foo} = {}
local function foo(arg: {name: string}?)
local name = if arg and arg.name then arg.name else nil
-- Previously would error as bidirectional inference would not
-- kick in as often.
table.insert(arr, {
name = name or "",
flag = name ~= nil and name ~= "",
})
endNative Codegen
- Lowering to arm64 for some local heavy functions will now succeed whereas prior they failed due to running out of registers for live values.
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: Sora Kanosue skanosue@roblox.com
Co-authored-by: Vighnesh Vijay vvijay@roblox.com
Co-authored-by: Vyacheslav Egorov vegorov@roblox.com
Full Changelog: 0.689...0.690