Skip to content

Releases: luau-lang/luau

0.652

15 Nov 23:14
e905e30
Compare
Choose a tag to compare

What's Changed

  • Add support for mixed-mode type checking, which allows modules checked
    in the old type solver to be checked and autocompleted by the new one.
  • Generalize RequireResolver to support require-by-string semantics in
    luau-analyze.
  • Fix a bug in incremental autocomplete where DefIds associated with
    index expressions were not correctly picked up.
  • Fix a bug that prevented "complex" types in generic parameters (for
    example, local x: X<(() -> ())?>).
  • CodeGen: Rewrite dot product lowering using a dedicated IR instruction by @zeux in #1512
  • Fix mesh-normal-vector benchmark array access by @zeux in #1514
  • Remove noexcepts from Config by @vrn-sn in #1523

Issues fixed

New Contributors

Full Changelog: 0.651...0.652


Internal Contributors:

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Varun Saini [email protected]
Co-authored-by: Vighnesh Vijay [email protected]

0.651

08 Nov 22:38
a36a3c4
Compare
Choose a tag to compare

What's Changed

  • Fragment Autocomplete: a new API allows for type checking a small fragment of code against an existing file, significantly speeding up autocomplete performance in large files.
  • Requiring a path with a ".lua" or ".luau" extension will now have a bespoke error suggesting to remove said extension.
  • Fixes a bug in which whether two Luau::Symbols are equal depends on whether the new solver is enabled.
  • Fix definition module name & location by @checkraisefold in #1495
  • Pre-populate/duplicate check class definitions (new solver) by @checkraisefold in #1493
  • Set the defining module even when the new solver cloned the type. by @aatxe in #1506
  • Replace old site urls by @Barocena in #1505

New Solver

  • E-Graphs have landed: this is an ongoing approach to make the new type solver simplify types in a more consistent and principled manner, based on similar work (see: https://egraphs-good.github.io/).
  • Adds support for exporting / local user type functions (previously they were always exported).
  • Fixes a set of bugs in which the new solver will fail to complete inference for simple expressions with just literals and operators.

General Updates

New Contributors

Full Changelog: 0.650...651


Internal Contributors:

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: David Cope [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Varun Saini [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

0.650

01 Nov 19:33
a251bc6
Compare
Choose a tag to compare

What's Changed

  • New vector library! See https://rfcs.luau.org/vector-library.html for details
  • Replace the use of non-portable strnlen with memchr. strnlen is not part of any C or C++ standard.
  • Introduce lua_newuserdatataggedwithmetatable for faster tagged userdata creation of userdata with metatables registered with lua_setuserdatametatable

Old Solver

  • It used to be the case that a module's result type would unconditionally be inferred to be any if it imported any module that participates in any import cycle. This is now fixed.

New Solver

  • Improve inference of table.freeze: We now infer read-only properties on tables after they have been frozen.
  • We now correctly flag cases where string.format is called with 0 arguments.
  • Fix a bug in user-defined type functions where table properties could be lost if the table had a metatable
  • Reset the random number seed for each evaluation of a type function
  • We now retry subtyping arguments if it failed due to hidden variadics.

Internal Contributors

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Aviral Goel [email protected]
Co-authored-by: David Cope [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

Full Changelog: 0.649...0.650

0.649

26 Oct 02:15
db80939
Compare
Choose a tag to compare

What's new?

  • More progress on the upcoming analysis API for fragment type inference.
  • Fix a bug in type normalization where intersection did not appropriately respect resource limits (affects new and old type solvers).
  • Allow type normalization to track cyclic pairs of types in inhabitance checks.
  • Fix a bug in the old type solver where Unifier did not necessarily live long enough.
  • Check the coroutine stack size before resuming in the Luau VM.

New Type Solver

  • Add support for typestating table.freeze and updated its behavior to transform the given table types into being marked read-only for all of its properties. More to come here for indexers when we add support for read-only indexers.
  • Fix #1453 by adding a missing arity check to string.format.
  • Fix a crash when editing caused by invalid AST states not being visited properly by the type solver.
  • Fix a crash in type simplification caused by missing follow calls.

Internal Contributors:

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

0.648

18 Oct 18:08
e491128
Compare
Choose a tag to compare

What's new

  • Added math.map function to the standard library, based on RFC for math.map
  • FileResolver can provide an implementation of getRequireSuggestions to provide auto-complete suggestions for require-by-string

New Solver

  • In user-defined type functions, readproperty and writeproperty will return nil instead of erroring if property is not found
  • Fixed incorrect scope of variadic arguments in the data-flow graph
  • Fixed multiple assertion failures

Internal Contributors:

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Varun Saini [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

Full Changelog: 0.647...0.648

0.647

12 Oct 00:59
77295c3
Compare
Choose a tag to compare

What's Changed

  • Rename type field of AstStatTypeAlias in JSON Encoder by @Dekkonot in #1461
  • Support function attributes in luau-ast by @Dekkonot in #1466
  • Fix an old solver crash that occurs in the presence of cyclic requires()

New Solver

  • Improvements to Luau user-defined type function library
  • Avoid asserting on unexpected metatable types
  • Properties in user defined type functions should have a consistent iteration order - in this case it is insertion ordering

Runtime

  • Track VM allocations for telemetry

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: James McNellis [email protected]
Co-authored-by: Varun Saini [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

Full Changelog: 0.646...0.647

0.646

04 Oct 18:43
543de6e
Compare
Choose a tag to compare

What's Changed?

  • Fix some cases where documentation symbols would not be available when mouseovering at certain positions in the code
  • Scaffolding to help embedders have more control over how typeof(x) refines types
  • Refinements to require-by-string semantics. See luau-lang/rfcs#56 for details.

New Solver

  • Fix many crashes in the new solver (thanks you for your bug reports!)
  • Type functions all evaluate in a single VM. This should improve typechecking performance and reduce memory use.
  • export type function is now forbidden and fails with a clear error message
  • Type functions that access locals in the surrounding environment are now properly a parse error
  • You can now use :setindexer(types.never, types.never) to delete an indexer from a table type.

Internal Contributors

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Varun Saini [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

Full Changelog: 0.645...0.646

0.645

27 Sep 19:02
02241b6
Compare
Choose a tag to compare

What's changed?

In this update, we continue to improve the overall stability of the new type solver. We're also shipping some early bits of two new features, one of the language and one of the analysis API: user-defined type functions and an incremental typechecking API.

If you use the new solver and want to use all new fixes included in this release, you have to reference an additional Luau flag:

LUAU_DYNAMIC_FASTINT(LuauTypeSolverRelease)

And set its value to 645:

DFInt::LuauTypeSolverRelease.value = 645; // Or a higher value for future updates

New Solver

  • Fix a crash where scopes are incorrectly accessed cross-module after they've been deallocated by appropriately zeroing out associated scope pointers for free types, generic types, table types, etc.
  • Fix a crash where we were incorrectly caching results for bound types in generalization.
  • Eliminated some unnecessary intermediate allocations in the constraint solver and type function infrastructure.
  • Built some initial groundwork for an incremental typecheck API for use by language servers.
  • Built an initial technical preview for user-defined type functions, more work still to come (including calling type functions from other type functions), but adventurous folks wanting to experiment with it can try it out by enabling FFlag::LuauUserDefinedTypeFunctionsSyntax and FFlag::LuauUserDefinedTypeFunctions in their local environment. Special thanks to @joonyoo181 who built up all the initial infrastructure for this during his internship!

Miscellaneous changes

  • Fix a compilation error on Ubuntu (fixes #1437)

Internal Contributors:

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Jeremy Yoo [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

0.644

20 Sep 17:39
f5dabc2
Compare
Choose a tag to compare

What's Changed

In this update we improve overall stability of the new type solver and address some type inference issues with it.

If you use the new solver and want to use all new fixes included in this release, you have to reference an additional Luau flag:

LUAU_DYNAMIC_FASTINT(LuauTypeSolverRelease)

And set its value to 644:

DFInt::LuauTypeSolverRelease.value = 644; // Or a higher value for future updates

New Solver

  • Fixed a debug assertion failure in autocomplete (Fixes #1391)
  • Fixed type function distribution issue which transformed len<> and unm<> into not<> (Fixes #1416)
  • Placed a limit on the possible normalized table intersection size as a temporary measure to avoid hangs and out-of-memory issues for complex type refinements
  • Internal recursion limits are now respected in the subtyping operations and in autocomplete, to avoid stack overflow crashes
  • Fixed false positive errors on assignments to tables whose indexers are unions of strings
  • Fixed memory corruption crashes in subtyping of generic types containing other generic types in their bounds

Internal Contributors:

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

Full Changelog: 0.643...0.644

0.643

13 Sep 18:54
b765d7b
Compare
Choose a tag to compare

What's Changed

  • keyof - fix LUAU_ASSERT when there's only one key entry by @karl-police in #1388
  • Add default "out" folder for CMake Project Visual Studio by @karl-police in #1394
  • Fix crash with the index type function, where it would stack overflow due to not waiting for a pending-expansion by @karl-police in #1407

New Solver

  • We now unconditionally generalize functions with explicit generics
  • Bugfixes for how we run builtin tests

VM

  • Fixed running Luau conformance tests in LUA_VECTOR_SIZE == 4 configuration

New Contributors

Full Changelog: 0.642...0.643


Internal Contributors:

Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: James McNellis [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]