Commit graph

1359 commits

Author SHA1 Message Date
checkraisefold
9a4bc6aeb8
Fix definition module name & location (#1495)
Closes #1441 

Brings behavior to parity with the old solver by filling in
definitionLocation and definitionModuleName for Luau-consuming
programs/libraries to use.
2024-11-05 10:33:21 -08:00
Andy Friesen
a251bc68a2
Sync to upstream/release/650 (#1502)
* 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.

---------

Co-authored-by: Aaron Weiss <aaronweiss@roblox.com>
Co-authored-by: Alexander McCord <amccord@roblox.com>
Co-authored-by: Vighnesh <vvijay@roblox.com>
Co-authored-by: Aviral Goel <agoel@roblox.com>
Co-authored-by: David Cope <dcope@roblox.com>
Co-authored-by: Lily Brown <lbrown@roblox.com>
Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
Co-authored-by: Junseo Yoo <jyoo@roblox.com>
2024-11-01 12:06:07 -07:00
Andy Friesen
c6cf1f829a Merge branch 'upstream' into merge 2024-11-01 09:47:58 -07:00
Andy Friesen
25de210308 Merge branch 'master' into merge 2024-11-01 09:47:55 -07:00
Andy Friesen
ee5b473b86 Sync to upstream/release/650 2024-11-01 09:47:10 -07:00
aaron
db809395bf
Sync to upstream/release/649 (#1489) 2024-10-25 16:15:01 -04:00
Aaron Weiss
e85fb91cfd Merge branch 'upstream' into merge 2024-10-25 09:46:45 -07:00
Aaron Weiss
ed05da573a Merge branch 'master' into merge 2024-10-25 09:46:40 -07:00
Aaron Weiss
1de169f006 Sync to upstream/release/649 2024-10-25 09:46:08 -07:00
vegorov-rbx
e491128f95
Sync to upstream/release/648 (#1477)
## What's new

* Added `math.map` function to the standard library, based on
https://rfcs.luau-lang.org/function-math-map.html
* `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 <aaronweiss@roblox.com>
Co-authored-by: Hunter Goldstein <hgoldstein@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>
2024-10-18 10:27:15 -07:00
Vyacheslav Egorov
ce9f1eb905 Merge branch 'upstream' into merge 2024-10-18 18:17:08 +03:00
Vyacheslav Egorov
bbd18bf0bd Merge branch 'master' into merge 2024-10-18 18:17:04 +03:00
Vyacheslav Egorov
47e3123863 Sync to upstream/release/648 2024-10-18 18:08:01 +03:00
Vighnesh-V
d7842e08ae
OSS cleanup - Sync/upstream/647 introduced unecessary new lines in Differ.cpp - this cleans it up (#1472) 2024-10-14 10:33:24 -07:00
Vighnesh-V
77295c3610
Sync to upstream/release/647 (#1469)
# General Updates
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 <aaronweiss@roblox.com>
Co-authored-by: Andy Friesen <afriesen@roblox.com>
Co-authored-by: Hunter Goldstein <hgoldstein@roblox.com>
Co-authored-by: James McNellis <jmcnellis@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>

---------

Co-authored-by: Aaron Weiss <aaronweiss@roblox.com>
Co-authored-by: Alexander McCord <amccord@roblox.com>
Co-authored-by: Andy Friesen <afriesen@roblox.com>
Co-authored-by: Aviral Goel <agoel@roblox.com>
Co-authored-by: David Cope <dcope@roblox.com>
Co-authored-by: Lily Brown <lbrown@roblox.com>
Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
Co-authored-by: Junseo Yoo <jyoo@roblox.com>
2024-10-11 17:48:30 -07:00
Vighnesh
fb8c190849 replicate changes to cmakelists 2024-10-11 17:16:39 -07:00
Vighnesh
268e0b2ab7 revert differ.h change 2024-10-11 17:13:33 -07:00
Vighnesh
837bba31e4 revert cmake file + update makefile 2024-10-11 16:57:52 -07:00
Vighnesh
5d74685798 unconditially add suppressing flag 2024-10-11 16:54:35 -07:00
Vighnesh
a7324ce8fb what happens if we remove the flag 2024-10-11 16:50:14 -07:00
Vighnesh
03c9fa721e try again? 2024-10-11 16:47:27 -07:00
Vighnesh
b5d3544d18 update build flags 2024-10-11 16:39:31 -07:00
Vighnesh
0276d18314 one more try 2024-10-11 16:30:15 -07:00
Vighnesh
b1fae55636 nit differ 2024-10-11 16:02:48 -07:00
Vighnesh
50e8dd0d71 more macro crimes 2024-10-11 15:47:58 -07:00
Vighnesh
dafee8bbef nest again 2024-10-11 15:37:54 -07:00
Vighnesh
c9ff5d1c0a nest pragma 2024-10-11 15:28:51 -07:00
Vighnesh
848fa0be8e insert new lines 2024-10-11 15:23:33 -07:00
Vighnesh
b76941b678 annotate this optional use 2024-10-11 15:21:25 -07:00
Vighnesh
507832b1f0 default initialize 2024-10-11 15:05:31 -07:00
Vighnesh
68b9214b03 push same change to shared code allocator 2024-10-11 14:51:28 -07:00
Vighnesh
a197f044b5 i messed up the macro syntax again 2024-10-11 14:49:34 -07:00
Vighnesh
ef95ce5266 newline 2024-10-11 14:40:12 -07:00
Vighnesh
39899ade4f macro out the failing tests 2024-10-11 14:33:15 -07:00
Vighnesh-V
34801b9310
Delete tests/.#TypeVar.test.cpp 2024-10-11 14:17:53 -07:00
Vighnesh
70d5a0ede8 newline 2024-10-11 14:16:41 -07:00
Vighnesh
74c1ac33a9 nit - insert new lines 2024-10-11 13:53:08 -07:00
Vighnesh
ee6a45b13b more macro madness 2024-10-11 13:46:54 -07:00
Vighnesh
69776f6fc1 re-add assertion 2024-10-11 13:39:14 -07:00
Vighnesh
f52fe9f351 nit - remove shared code allocator test section that tests self move 2024-10-11 13:22:20 -07:00
Vighnesh
a02bee5acc update -Wmaybe-uninitialized 2024-10-11 13:09:26 -07:00
Vighnesh
5bb24aa888 nit: turn int osize, nsize into size_t 2024-10-11 13:01:31 -07:00
Vighnesh
38d76e658d disable maybe uninitialized error 2024-10-11 12:56:47 -07:00
Vighnesh
0e1504fa52 try a different syntax for disabling warnings 2024-10-11 12:13:24 -07:00
Vighnesh
afa4fa601e try to disable self-move warning 2024-10-11 12:04:28 -07:00
Vighnesh
912798e5c7 Merge branch 'upstream' into merge 2024-10-11 10:05:43 -07:00
Vighnesh
40a054abe8 Merge branch 'master' into merge 2024-10-11 10:02:42 -07:00
Vighnesh
aa2e5c096d Sync to upstream/release/647 2024-10-11 09:38:27 -07:00
Micah
4559ef26b2
Support function attributes in luau-ast (#1466)
Noticed while using luau-ast that function attributes aren't included in
the output. This PR corrects that.
---------

Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2024-10-08 06:57:41 -07:00
Micah
ae7b07d60f
Rename type field of AstStatTypeAlias in JSON Encoder (#1461)
Closes #1460.

This renames the `type` field of `AstStatTypeAlias` to `value` during
the JSON encoding process.

I've chosen to just rename the field in the JSON encoder rather than
rename the actual field since it's a lot further reaching. Another
option would have been to rename what the actual type of an AST node is
written to be something like `tokenType` instead of `type`, but that's a
bigger diff and technically breaking (as opposed to this one which
isn't!)
2024-10-04 16:00:25 -07:00