luau/CodeGen/src
menarulalam a8d14596e7
Sync to upstream/release/669 (#1770)
We have lots of new changes for you! 

# What's Changed
## General

- We updated Luau's license year to 2025! 
- We fixed a bug where large amounts of errors were being printed when
deep intersections of unions error.


## Require-by-String
This release introduces the `Luau.Require` library, which exposes the
runtime semantics of require-by-string, including support for the new
`@self` alias described in [this
RFC](https://github.com/luau-lang/rfcs/pull/109).

The library operates on a virtualized filesystem, allowing consumers to
specify navigation rules without assuming a filesystem context.
Documentation in `Require.h` explains how to enable the library, and the
`setupState` function in Repl.cpp demonstrates how we've integrated it
into the luau CLI tool. Note that the interface in `Require.h` is
written in C, which enables any application written in a language with a
C foreign-function interface to link against this library and enable
require-by-string. This makes it straightforward for any application
embedding Luau to support require-by-string, provided that it defines or
operates within an environment resembling a virtual filesystem.

The core navigation semantics of require-by-string have additionally
been pulled into the `Luau.RequireNavigator` library. While
`Luau.Require` internally depends on `Luau.RequireNavigator`, the latter
does not depend on the Luau VM. This library provides an interface for
inspecting require-by-string's navigation behavior and therefore serves
as a useful dependency for static tooling. Documentation for
`Luau.RequireNavigator` is available in `RequireNavigator.h`.
## Autocomplete
- We fixed a memory leak in fragment autocomplete!
## New Solver And Old Solver
- We've found a infinite iteration error over a type pack. We added a
way to detect this error and throw an `InternalCompileError` instead.
- We fix `table.freeze` not accounting for the first argument not
getting type stated. We fall back to regular inference instead.
- We fix a crash in the old solver with `length_error`.
- We fix a crash in the new solver stemming from generalization
reentrancy. Now we correctly generalize interior free types that do not
appear in a function signature.
- We fix a nil refinement. (Fixes
https://github.com/luau-lang/luau/issues/1687 and
https://github.com/luau-lang/luau/issues/1451)



### Internal Contributors
Co-authored-by: Andy Friesen <afriesen@roblox.com>
Co-authored-by: Hunter Goldstein <hgoldstein@roblox.com>
Co-authored-by: Talha Pathan <tpathan@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>

Full Changelog: https://github.com/luau-lang/luau/compare/0.668...0.669

---------

Co-authored-by: Hunter Goldstein <hgoldstein@roblox.com>
Co-authored-by: Varun Saini <61795485+vrn-sn@users.noreply.github.com>
Co-authored-by: Alexander Youngblood <ayoungblood@roblox.com>
Co-authored-by: Aviral Goel <agoel@roblox.com>
Co-authored-by: Vighnesh <vvijay@roblox.com>
Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
Co-authored-by: Ariel Weiss <aaronweiss@roblox.com>
2025-04-11 17:44:21 -07:00
..
AssemblyBuilderA64.cpp Sync to upstream/release/653 (#1541) 2024-11-22 13:00:51 -08:00
AssemblyBuilderX64.cpp CodeGen: Implement support for math.lerp lowering (#1609) 2025-01-16 10:48:27 -08:00
BitUtils.h Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
BytecodeAnalysis.cpp Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
BytecodeSummary.cpp Sync to upstream/release/653 (#1541) 2024-11-22 13:00:51 -08:00
ByteUtils.h Sync to upstream/release/603 (#1097) 2023-11-10 13:10:07 -08:00
CodeAllocator.cpp Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
CodeBlockUnwind.cpp Sync to upstream/release/662 (#1681) 2025-02-21 10:24:12 -08:00
CodeGen.cpp Sync to upstream/release/663 (#1699) 2025-02-28 14:42:30 -08:00
CodeGenA64.cpp Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
CodeGenA64.h Sync to upstream/release/629 (#1290) 2024-06-07 10:51:12 -07:00
CodeGenAssembly.cpp Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
CodeGenContext.cpp Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
CodeGenContext.h Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
CodeGenLower.h Sync to upstream/release/663 (#1699) 2025-02-28 14:42:30 -08:00
CodeGenUtils.cpp Sync to upstream/release/669 (#1770) 2025-04-11 17:44:21 -07:00
CodeGenUtils.h Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
CodeGenX64.cpp Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
CodeGenX64.h Sync to upstream/release/629 (#1290) 2024-06-07 10:51:12 -07:00
EmitBuiltinsX64.cpp Sync to upstream/release/640 (#1374) 2024-08-23 09:35:30 -07:00
EmitBuiltinsX64.h Sync to upstream/release/631 (#1299) 2024-06-20 16:37:55 -07:00
EmitCommon.h Sync to upstream/release/606 (#1127) 2023-12-08 13:50:16 -08:00
EmitCommonA64.h Sync to upstream/release/629 (#1290) 2024-06-07 10:51:12 -07:00
EmitCommonX64.cpp Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
EmitCommonX64.h Sync to upstream/release/629 (#1290) 2024-06-07 10:51:12 -07:00
EmitInstructionX64.cpp Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
EmitInstructionX64.h Sync to upstream/release/592 (#1018) 2023-08-25 10:23:55 -07:00
IrAnalysis.cpp Sync to upstream/release/656 (#1612) 2025-01-10 11:34:39 -08:00
IrBuilder.cpp Sync to upstream/release/640 (#1374) 2024-08-23 09:35:30 -07:00
IrCallWrapperX64.cpp Sync to upstream/release/613 (#1167) 2024-02-15 18:04:39 -08:00
IrDump.cpp CodeGen: Implement support for math.lerp lowering (#1609) 2025-01-16 10:48:27 -08:00
IrLoweringA64.cpp Sync to upstream/release/663 (#1699) 2025-02-28 14:42:30 -08:00
IrLoweringA64.h Sync to upstream/release/629 (#1290) 2024-06-07 10:51:12 -07:00
IrLoweringX64.cpp Sync to upstream/release/663 (#1699) 2025-02-28 14:42:30 -08:00
IrLoweringX64.h Sync to upstream/release/629 (#1290) 2024-06-07 10:51:12 -07:00
IrRegAllocA64.cpp Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
IrRegAllocA64.h Sync to upstream/release/595 (#1044) 2023-09-15 10:26:59 -07:00
IrRegAllocX64.cpp Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
IrTranslateBuiltins.cpp Sync to upstream/release/663 (#1699) 2025-02-28 14:42:30 -08:00
IrTranslateBuiltins.h Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
IrTranslation.cpp Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
IrTranslation.h Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
IrUtils.cpp Sync to upstream/release/663 (#1699) 2025-02-28 14:42:30 -08:00
IrValueLocationTracking.cpp Sync to upstream/release/640 (#1374) 2024-08-23 09:35:30 -07:00
IrValueLocationTracking.h Sync to upstream/release/596 (#1050) 2023-09-22 12:12:15 -07:00
lcodegen.cpp Sync to upstream/release/625 (#1252) 2024-05-10 11:21:45 -07:00
NativeProtoExecData.cpp Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
NativeState.cpp Sync to upstream/release/633 (#1318) 2024-07-08 14:57:06 -07:00
NativeState.h Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
OptimizeConstProp.cpp Sync to upstream/release/663 (#1699) 2025-02-28 14:42:30 -08:00
OptimizeDeadStore.cpp Sync to upstream/release/659 (#1637) 2025-01-31 18:58:36 -08:00
OptimizeFinalX64.cpp Sync to upstream/release/615 (#1175) 2024-03-01 10:45:26 -08:00
SharedCodeAllocator.cpp Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
UnwindBuilderDwarf2.cpp Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
UnwindBuilderWin.cpp Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00