Commit Graph

816 Commits

Author SHA1 Message Date
Vyacheslav Egorov
36f5009026 Sync to upstream/release/558 2023-01-06 18:07:19 +02:00
vegorov-rbx
75a2e95714
Sync to upstream/release/557 (#794)
* Fixed unions of `nil` types displaying as `?`
* Internal normalization now handles class types which can make
previously failing (incorrectly) sub-typing checks to succeed
2023-01-04 12:53:17 -08:00
Vyacheslav Egorov
1958676f29 Re-using uncleared normalizer in unsafe 2023-01-04 14:45:18 +02:00
Vyacheslav Egorov
ee364a33b4 Fixed iterator invalidation issue 2023-01-04 00:31:14 +02:00
Vyacheslav Egorov
c48b4d7228 Merge branch 'upstream' into merge 2023-01-03 19:49:36 +02:00
Vyacheslav Egorov
11e129ff00 Merge branch 'master' into merge 2023-01-03 19:49:30 +02:00
Vyacheslav Egorov
9958d23caa Sync to upstream/release/557 2023-01-03 19:33:19 +02:00
Andy Friesen
fb2f146123
Sync to upstream/release/556 (#782)
* The AST JSON encoder will now stringify infinity and NaN according to the JSON5 spec using the tokens `Infinity`, `-Infinity`, and `NaN`.
* Improve autocompletion of table keys if the type of that key is a union of string singletons.
2022-12-09 11:57:01 -08:00
Andy Friesen
1197bcd5c7 Merge branch 'upstream' into merge 2022-12-09 10:08:20 -08:00
Andy Friesen
4ba102f304 Merge branch 'master' into merge 2022-12-09 10:08:16 -08:00
Andy Friesen
abe6768a1d Sync to upstream/release/556 2022-12-09 10:07:25 -08:00
Alex Orlenko
e9d4ee7a33
Make pseudo-indices relative to LUAI_MAXCSTACK (#766)
This is useful in particular if redefine `LUAI_MAXCSTACK` to a higher
value than the current one (8000).
Ie. passing `-D LUAI_MAXCSTACK=1000000` would not work as overlaps with
`LUA_REGISTRYINDEX` and below.
2022-12-06 11:20:24 -08:00
vegorov-rbx
4e6ae32625
Luau Recap: November 2022 (#764)
Co-authored-by: Andy Friesen <andy.friesen@gmail.com>
2022-12-02 10:23:20 -08:00
vegorov-rbx
59ae47db43
Sync to upstream/release/555 (#768)
* Type mismatch errors now mention if unification failed in covariant or
invariant context, to explain why sometimes derived class can't be
converted to base class or why `T` can't be converted into `T?` and so
on
* Class type indexing is no longer an error in non-strict mode (still an
error in strict mode)
* Fixed cyclic type packs not being displayed in the type
* Added an error when unrelated types are compared with `==`/`~=`
* Fixed false positive errors involving sub-type tests an `never` type
* Fixed miscompilation of multiple assignment statements (Fixes
https://github.com/Roblox/luau/issues/754)
* Type inference stability improvements
2022-12-02 10:09:59 -08:00
vegorov-rbx
91302d1d4c
Fix coverage github action by using clang++ without a specific version (#769)
Github fails to find clang++-10.
Since we install llvm without a specific version number, we shouldn't
use clang++-10 with a version number.

I tried installing llvm-10, but that package is not available on github
(any more?).
2022-12-02 10:08:55 -08:00
Vyacheslav Egorov
6cd507dff0 Work-around for gcc 2022-12-02 18:22:01 +02:00
Vyacheslav Egorov
f10b294d62 What even is this 2022-12-02 15:46:09 +02:00
Vyacheslav Egorov
621d21d4c2 Merge branch 'upstream' into merge 2022-12-02 12:58:55 +02:00
Vyacheslav Egorov
471ec75a60 Merge branch 'master' into merge 2022-12-02 12:56:19 +02:00
Vyacheslav Egorov
fc459699da Sync to upstream/release/555 2022-12-02 12:46:05 +02:00
JohnnyMorganz
9095fc4b83
Support __call on class type vars (#762)
Currently, the metatable of a class type var is not correctly checked to
see if it is callable (i.e. has a `__call` metatable).
We resolve this issue by checking the metatable in `checkCallOverload`

Fixes #756

Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-11-28 10:02:41 -08:00
JohnnyMorganz
7dbe47f4dd
Handle cyclically referenced declared classes (#729)
Closes #631 

Performs a "two pass" approach, where we first call `prototype` on the
class definition.
The prototype phase checks for errors and creates a base CTV for the
class, which other types can then reference.

The second `check` phase fills it out with all the defined
properties/methods

Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-11-28 05:25:44 -08:00
Andy Friesen
95d9c6d194
Sync to upstream/release/553 (#751)
* Autocomplete support for interpolated strings.
* Improved parse errors in various situations involving interpolated
strings.
2022-11-18 11:47:21 -08:00
Andy Friesen
3ac3798e79 Merge branch 'upstream' into merge 2022-11-18 10:52:52 -08:00
Andy Friesen
d5ff348e4e Merge remote-tracking branch 'origin/master' into merge 2022-11-18 10:52:40 -08:00
Andy Friesen
f52169509c Sync to upstream/release/554 2022-11-18 10:45:14 -08:00
boyned//Kampfkarren
aa7c64517c
Fix string interpolation autocomplete and location (#748)
String interpolation autocomplete was not working and was just using
default autocomplete. This fixes it so that inside a string it is
treated as normal, and inside an expression it suggests expression level
autocomplete.

Also fixes the range, which was previously just the first lexeme.
2022-11-16 10:15:01 -08:00
vegorov-rbx
816e41a8f2
Sync to upstream/release/553 (#742)
* Type inference of `a and b` and `a or b` has been improved (Fixes
https://github.com/Roblox/luau/issues/730)
* Improved error message when `for ... in x` loop iterates over a value
that could be 'nil'
* Return type of `next` not includes 'nil' (Fixes
https://github.com/Roblox/luau/issues/706)
* Improved type inference of `string` type
* Luau library table type names are now reported as `typeof(string)`/etc
instead of just `string` which was misleading
* Added parsing error when optional type alias type parameter wasn't
provided after `=` token
* Improved tagged union type refinement in conditional expressions, type
in `else` branch should no longer include previously handled union
options
2022-11-10 14:53:13 -08:00
Vyacheslav Egorov
2b36613293 Merge branch 'upstream' into merge 2022-11-11 00:12:57 +02:00
Vyacheslav Egorov
3289fc1b85 Merge remote-tracking branch 'upstream/master' into merge 2022-11-11 00:12:36 +02:00
Vyacheslav Egorov
3155ba0358 Sync to upstream/release/553 2022-11-11 00:04:44 +02:00
Arseny Kapoulkine
0f04d521e6
Add "Luau origins and evolution" post (#737) 2022-11-04 15:26:37 -07:00
Andy Friesen
c33700e473
Sync to upstream/release/552 (#735)
* Reduce the stack utilization of type checking.
* Improve the error message that's reported when a delimiting comma is
missing from a table literal. eg
```lua
local t = {
    first = 1
    second = 2
}```
2022-11-04 10:33:22 -07:00
Andy Friesen
8fd7d22046 Merge branch 'upstream' into merge 2022-11-04 10:04:57 -07:00
Andy Friesen
d189305fa8 Merge branch 'master' into merge 2022-11-04 10:03:15 -07:00
Andy Friesen
e3fdab3082 Sync to upstream/release/552 2022-11-04 10:02:37 -07:00
Alan Jeffrey
e43a9e927c
Added Sep-Oct 2022 Luau Recap (#726) 2022-11-01 12:02:03 -05:00
boyned//Kampfkarren
e37eb3c778
Fix { range to be within the interpolated string (#728)
Corrects `{` range to be inside the interpolated string, needed for syntax highlighting.
2022-10-28 12:22:26 -07:00
vegorov-rbx
a6b5051edc
Sync to upstream/release/551 (#727)
* https://github.com/Roblox/luau/pull/719
* Improved `Failed to unify type packs` error message to be reported as
`Type pack 'X' could not be converted into 'Y'`
* https://github.com/Roblox/luau/pull/722
* 1% reduction in executed instruction count by removing a check in fast
call dispatch
* Additional fixes to reported error location of OOM errors in VM
* Improve `math.sqrt`, `math.floor` and `math.ceil` performance on
additional compilers and platforms (1-2% geomean improvement including
8-9% on math-cordic)
* All thrown exceptions by Luau analysis are derived from
`Luau::InternalCompilerError`
* When a call site has fewer arguments than required, error now reports
the location of the function name instead of the argument to the
function
* https://github.com/Roblox/luau/pull/724
* Fixed https://github.com/Roblox/luau/issues/725

Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Co-authored-by: Andy Friesen <afriesen@roblox.com>
2022-10-28 03:37:29 -07:00
Arseny Kapoulkine
a6cbb0f65c Fix clang-14 / GNU ld interaction for target_clones 2022-10-27 17:47:14 -07:00
Vyacheslav Egorov
b4b125c727 Merge branch 'upstream' into merge 2022-10-28 01:36:59 +03:00
Vyacheslav Egorov
dbedb3c859 Merge remote-tracking branch 'upstream/master' into merge 2022-10-28 01:35:18 +03:00
Vyacheslav Egorov
99c0db3b08 Sync to upstream/release/551 2022-10-28 01:22:49 +03:00
JohnnyMorganz
ad7d006fb2
Use overloaded documentation symbol for class methods/table props (#724)
Right now `getDocumentationSymbol` on an overloaded class method or
table prop just gives the prop name, not prepended with `/overload/ +
toString(overload)`.

This causes the incorrect symbol to be used for `table.insert`,
`BrickColor.new`, `Color3.new` etc. (present in
https://raw.githubusercontent.com/MaximumADHD/Roblox-Client-Tracker/roblox/api-docs/en-us.json)

Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-10-25 16:22:19 -07:00
Arseny Kapoulkine
e64d489e57
Update benchmark.yml
Add codegennull runs to compile time benchmarks
2022-10-24 17:24:19 -07:00
Andy Friesen
54324867df
Sync to upstream/release/550 (#723)
* Support `["prop"]` syntax on class definitions in definition files.
(#704)
* Improve type checking performance for complex overloaded functions
* Fix rare cases of incorrect stack traces for out of memory errors at
runtime
2022-10-21 10:54:01 -07:00
Andy Friesen
b9451c6f68 Merge branch 'upstream' into merge 2022-10-21 10:34:21 -07:00
Andy Friesen
72fdf6f03a Merge branch 'master' into merge 2022-10-21 10:34:17 -07:00
Andy Friesen
2eff6cfe50 Sync to upstream/release/550 2022-10-21 10:33:43 -07:00
JohnnyMorganz
12ee1407a1
Add named parameters to math lib (#722)
Name the parameters used in `math` lib

This is mainly done to highlight the particular confusion for
`math.atan2`, where `y` comes before `x`, but this might not be
immediately obvious.

And then I added the rest of the names for consistency.

Note: I didn't add names to `math.random` as it's currently typed as
`(number?, number?) -> number`. Naming it `min` and `max` is technically
incorrect for the 1 argument version.
Maybe it should be typed as an intersection instead?
2022-10-21 08:05:56 -07:00