You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone!
This week we have type inference improvements for refinements and
user-defined type functions as well as new optimizations in Native Code
Generation.
Merged earlier, but now available in the release are implementations of
[math.isnan, math.isinf and math.isfinite for Math
Library](https://rfcs.luau.org/math-isnan-isfinite-isinf.html) RFC and
long awaited [Explicit type parameter
instantiation](https://rfcs.luau.org/explicit-type-parameter-instantiation.html)
RFC!
### What's New
- Fixed a bug that incorrectly allowed chained aliases to depend on
aliases defined in deeper directories
- Added an optional `to_alias_fallback` C API to natively support
host-injected aliases
- Fixed building fuzzers using make
- Fixed serialization of userdata type mappings from `userdataTypes`
compiler option which caused a crash on bytecode load
## Analysis
- Recursion counters have been added to the non-strict mode typechecker
to prevent crashes
- Irreducible user-defined type functions are now marked as solved,
improving consistency of type inference results
- Refinements against `unknown` type now work more consistently,
resulting in more accurate inference
```luau
--!strict
local Class = {}
Class.__index = Class
type Class = setmetatable<{ A: number }, typeof(Class)>
function Class.Foo(x: Class, y: Class, z: Class)
if y == z then
return
end
local bar = y.A -- correctly infers number instead of any
end
```
## Runtime
- Added load-store optimizations for loading components of a vector in
Native Code Generation (NCG). This should reduce the need to place
repeatedly accessed vector components in locals and improve vector
component shuffling
- NCG will exit to VM earlier when unsafe environment is detected,
reducing work it has to throw away
- NCG will now optimize better across interrupt callback invocations;
interrupts are to observe state and error/yield, general modification of
VM state is not allowed in it
## Internal Contributors
Co-authored-by: Andy Friesen <[email protected]>
Co-authored-by: Annie Tang <[email protected]>
Co-authored-by: Ariel Weiss <[email protected]>
Co-authored-by: Hunter Goldstein <[email protected]>
Co-authored-by: Ilya Rezvov <[email protected]>
Co-authored-by: Sora Kanosue <[email protected]>
Co-authored-by: Varun Saini <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>
0 commit comments