Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync to upstream/release/593 #1024

Merged
merged 168 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
c6ac06e
Sync to upstream/release/543
zeux Sep 1, 2022
75b8a2a
Merge branch 'upstream' into merge
zeux Sep 1, 2022
dec4b67
Sync to upstream/release/544
zeux Sep 8, 2022
ff18a63
Merge branch 'master' into merge
zeux Sep 8, 2022
71df988
Merge branch 'upstream' into merge
zeux Sep 8, 2022
6c70897
Patch the test for now to work with 16K pages
zeux Sep 8, 2022
dd710f6
Sync to upstream/release/545
zeux Sep 15, 2022
19ac72a
Merge branch 'master' into merge
zeux Sep 15, 2022
6e957a4
Merge branch 'upstream' into merge
zeux Sep 15, 2022
48fb5a3
Sync to upstream/release/546
zeux Sep 23, 2022
cd66ad6
Merge branch 'master' into merge
zeux Sep 23, 2022
7bea908
Merge branch 'upstream' into merge
zeux Sep 23, 2022
4176e1c
Fix internals library
zeux Sep 23, 2022
d0989b9
Sync to upstream/release/547
zeux Sep 29, 2022
123649d
Merge branch 'master' into merge
zeux Sep 29, 2022
ebf252f
Merge branch 'upstream' into merge
zeux Sep 29, 2022
91e144a
Sync to upstream/release/548
zeux Oct 6, 2022
9bfe2b8
Merge branch 'master' into merge
zeux Oct 6, 2022
4a79c7f
Merge branch 'upstream' into merge
zeux Oct 6, 2022
d82e736
Sync to upstream/release/549
vegorov-rbx Oct 13, 2022
6aafd2b
Merge branch 'master' into merge
vegorov-rbx Oct 13, 2022
1dca05d
Merge branch 'upstream' into merge
vegorov-rbx Oct 13, 2022
48fd16d
Fix build error
vegorov-rbx Oct 14, 2022
6a98d15
Responding to PR comments
vegorov-rbx Oct 14, 2022
2eff6cf
Sync to upstream/release/550
andyfriesen Oct 21, 2022
72fdf6f
Merge branch 'master' into merge
andyfriesen Oct 21, 2022
b9451c6
Merge branch 'upstream' into merge
andyfriesen Oct 21, 2022
99c0db3
Sync to upstream/release/551
vegorov-rbx Oct 27, 2022
dbedb3c
Merge remote-tracking branch 'upstream/master' into merge
vegorov-rbx Oct 27, 2022
b4b125c
Merge branch 'upstream' into merge
vegorov-rbx Oct 27, 2022
a6cbb0f
Fix clang-14 / GNU ld interaction for target_clones
zeux Oct 28, 2022
e3fdab3
Sync to upstream/release/552
andyfriesen Nov 4, 2022
d189305
Merge branch 'master' into merge
andyfriesen Nov 4, 2022
8fd7d22
Merge branch 'upstream' into merge
andyfriesen Nov 4, 2022
3155ba0
Sync to upstream/release/553
vegorov-rbx Nov 10, 2022
3289fc1
Merge remote-tracking branch 'upstream/master' into merge
vegorov-rbx Nov 10, 2022
2b36613
Merge branch 'upstream' into merge
vegorov-rbx Nov 10, 2022
f521695
Sync to upstream/release/554
andyfriesen Nov 18, 2022
d5ff348
Merge remote-tracking branch 'origin/master' into merge
andyfriesen Nov 18, 2022
3ac3798
Merge branch 'upstream' into merge
andyfriesen Nov 18, 2022
fc45969
Sync to upstream/release/555
vegorov-rbx Dec 2, 2022
471ec75
Merge branch 'master' into merge
vegorov-rbx Dec 2, 2022
621d21d
Merge branch 'upstream' into merge
vegorov-rbx Dec 2, 2022
f10b294
What even is this
vegorov-rbx Dec 2, 2022
6cd507d
Work-around for gcc
vegorov-rbx Dec 2, 2022
abe6768
Sync to upstream/release/556
andyfriesen Dec 9, 2022
4ba102f
Merge branch 'master' into merge
andyfriesen Dec 9, 2022
1197bcd
Merge branch 'upstream' into merge
andyfriesen Dec 9, 2022
9958d23
Sync to upstream/release/557
vegorov-rbx Jan 3, 2023
11e129f
Merge branch 'master' into merge
vegorov-rbx Jan 3, 2023
c48b4d7
Merge branch 'upstream' into merge
vegorov-rbx Jan 3, 2023
ee364a3
Fixed iterator invalidation issue
vegorov-rbx Jan 3, 2023
1958676
Re-using uncleared normalizer in unsafe
vegorov-rbx Jan 4, 2023
36f5009
Sync to upstream/release/558
vegorov-rbx Jan 6, 2023
5e3fbc4
Merge branch 'master' into merge
vegorov-rbx Jan 6, 2023
cf45ce6
Merge branch 'upstream' into merge
vegorov-rbx Jan 6, 2023
5db9675
Smaller recursion limit to not hit stack overflow in debug on Windows
vegorov-rbx Jan 6, 2023
a2365f2
Fix build warning
vegorov-rbx Jan 6, 2023
96c1caf
Sync to upstream/release/559
andyfriesen Jan 13, 2023
b1000a6
Merge branch 'master' into merge
andyfriesen Jan 13, 2023
efaf15e
Merge branch 'upstream' into merge
andyfriesen Jan 13, 2023
eec289a
Sync to upstream/release/560
vegorov-rbx Jan 20, 2023
652f319
Merge branch 'master' into merge
vegorov-rbx Jan 20, 2023
7a43ae3
Merge branch 'upstream' into merge
vegorov-rbx Jan 20, 2023
b0b7dfb
Fix a few style changes that went out-of-sync
vegorov-rbx Jan 20, 2023
53d03f9
Sync to upstream/release/561
andyfriesen Jan 27, 2023
7c5dd3c
Merge branch 'master' into merge
andyfriesen Jan 27, 2023
a17481b
Merge branch 'upstream' into merge
andyfriesen Jan 27, 2023
b7af49c
Fix signed/unsigned comparison warnings on GCC.
andyfriesen Jan 27, 2023
523db5e
Another GCC fix.
andyfriesen Jan 27, 2023
dba2936
Sync to upstream/release/562
vegorov-rbx Feb 3, 2023
f49f073
Merge branch 'master' into merge
vegorov-rbx Feb 3, 2023
c76dd1c
Merge branch 'upstream' into merge
vegorov-rbx Feb 3, 2023
b388e27
Sync to upstream/release/563
andyfriesen Feb 10, 2023
41ff9cb
Merge branch 'master' into merge
andyfriesen Feb 10, 2023
c3b1945
Merge branch 'upstream' into merge
andyfriesen Feb 10, 2023
5c77305
Sync to upstream/release/564
vegorov-rbx Feb 17, 2023
1f8ec89
Merge branch 'master' into merge
vegorov-rbx Feb 17, 2023
be06c31
Merge branch 'upstream' into merge
vegorov-rbx Feb 17, 2023
1e7b23f
Sync to upstream/release/565
andyfriesen Feb 24, 2023
3974fcc
Merge branch 'master' into merge
andyfriesen Feb 24, 2023
7a822c9
Merge branch 'upstream' into merge
andyfriesen Feb 24, 2023
e58bb1b
GCC fix.
andyfriesen Feb 24, 2023
9a281f0
Sync to upstream/release/566
vegorov-rbx Mar 3, 2023
ca34b44
Merge branch 'master' into merge
vegorov-rbx Mar 3, 2023
ac9718e
Merge branch 'upstream' into merge
vegorov-rbx Mar 3, 2023
4653484
Sync to upstream/release/567
andyfriesen Mar 10, 2023
cfee765
Merge branch 'master' into merge
andyfriesen Mar 10, 2023
a0fe195
Merge branch 'upstream' into merge
andyfriesen Mar 10, 2023
e280064
Sync to upstream/release/568
vegorov-rbx Mar 17, 2023
bbeec10
Merge branch 'master' into merge
vegorov-rbx Mar 17, 2023
1c4d7a6
Merge branch 'upstream' into merge
vegorov-rbx Mar 17, 2023
81200e1
Sync to upstream/release/569
andyfriesen Mar 24, 2023
ce18822
Merge branch 'master' into merge
andyfriesen Mar 24, 2023
c955451
Merge branch 'upstream' into merge
andyfriesen Mar 24, 2023
d1acde3
Sync to upstream/release/570
vegorov-rbx Mar 31, 2023
c6b6ab6
Merge branch 'master' into merge
vegorov-rbx Mar 31, 2023
d70df63
Merge branch 'upstream' into merge
vegorov-rbx Mar 31, 2023
d071e41
g++ build fix
vegorov-rbx Mar 31, 2023
5309401
Sync to upstream/release/571
andyfriesen Apr 7, 2023
97f8bf6
Merge branch 'master' into merge
andyfriesen Apr 7, 2023
395bf5c
Merge branch 'upstream' into merge
andyfriesen Apr 7, 2023
5e771b8
Sync to upstream/release/572
vegorov-rbx Apr 14, 2023
70ef0fb
Merge branch 'master' into merge
vegorov-rbx Apr 14, 2023
1ffbf6c
Merge branch 'upstream' into merge
vegorov-rbx Apr 14, 2023
33b9558
Build fix
vegorov-rbx Apr 14, 2023
d5cdb68
Sync to upstream/release/573
andyfriesen Apr 21, 2023
a0f9842
Merge branch 'master' into merge
andyfriesen Apr 21, 2023
1126490
Merge branch 'upstream' into merge
andyfriesen Apr 21, 2023
1c2ce0d
Sync to upstream/release/574
vegorov-rbx Apr 28, 2023
8bd3714
Merge branch 'master' into merge
vegorov-rbx Apr 28, 2023
348f85c
Merge branch 'upstream' into merge
vegorov-rbx Apr 28, 2023
716f633
Sync to upstream/release/575
andyfriesen May 5, 2023
cc96f86
Merge branch 'master' into merge
andyfriesen May 5, 2023
95f0a04
Merge branch 'upstream' into merge
andyfriesen May 5, 2023
12c1edf
This test fails on a64 so disable it for now.
andyfriesen May 5, 2023
f7c7801
Add pthread as a link dependency to Luau.Analyze.CLI for Linux.
andyfriesen May 5, 2023
3247aab
Sync to upstream/release/576
vegorov-rbx May 12, 2023
38ab2e5
Merge branch 'master' into merge
vegorov-rbx May 12, 2023
59c2698
Merge branch 'upstream' into merge
vegorov-rbx May 12, 2023
eb71060
Sync to upstream/release/577
andyfriesen May 19, 2023
4fb7594
Merge branch 'master' into merge
andyfriesen May 19, 2023
f3a6e37
Merge branch 'upstream' into merge
andyfriesen May 19, 2023
123496b
gcc fix.
andyfriesen May 19, 2023
b8e9d07
Sync to upstream/release/578
vegorov-rbx May 25, 2023
f97a897
Merge branch 'master' into merge
vegorov-rbx May 25, 2023
fc9557d
Merge branch 'upstream' into merge
vegorov-rbx May 25, 2023
f435740
Sync to upstream/release/579
andyfriesen Jun 2, 2023
349d6f4
Merge branch 'master' into merge
andyfriesen Jun 2, 2023
a3d22de
Merge branch 'upstream' into merge
andyfriesen Jun 2, 2023
88cd3dd
Sync to upstream/release/580
vegorov-rbx Jun 9, 2023
ef2e46e
Merge branch 'master' into merge
vegorov-rbx Jun 9, 2023
a9becc9
Merge branch 'upstream' into merge
vegorov-rbx Jun 9, 2023
212888c
Fix build warning
vegorov-rbx Jun 9, 2023
6ee4f19
Sync to upstream/release/581
andyfriesen Jun 16, 2023
f9cfef1
Merge branch 'master' into merge
andyfriesen Jun 16, 2023
00b9898
Merge branch 'upstream' into merge
andyfriesen Jun 16, 2023
8bc2f51
Sync to upstream/release/582
vegorov-rbx Jun 24, 2023
7a2f94a
Merge branch 'master' into merge
vegorov-rbx Jun 24, 2023
e1a7c3b
Merge branch 'upstream' into merge
vegorov-rbx Jun 24, 2023
e00dbbe
Sync to upstream/release/583
andyfriesen Jul 7, 2023
01cbf18
Merge branch 'master' into merge
andyfriesen Jul 7, 2023
b92d4d7
Merge branch 'upstream' into merge
andyfriesen Jul 7, 2023
dc2a1cc
GCC fix.
andyfriesen Jul 7, 2023
b403075
Sync to upstream/release/584
vegorov-rbx Jul 14, 2023
03063d0
Merge branch 'master' into merge
vegorov-rbx Jul 14, 2023
4ffa98f
Merge branch 'upstream' into merge
vegorov-rbx Jul 14, 2023
f16d002
GCC fix
vegorov-rbx Jul 14, 2023
5e1aca1
Sync to upstream/release/588
vegorov-rbx Jul 28, 2023
9fd79ad
Merge branch 'master' into merge
vegorov-rbx Jul 28, 2023
4c6a370
Merge branch 'upstream' into merge
vegorov-rbx Jul 28, 2023
25cc75b
* Progress toward a diffing algorithm for types. We hope that this w…
andyfriesen Aug 4, 2023
e25b717
Merge branch 'master' into merge
andyfriesen Aug 4, 2023
b26eeac
Merge branch 'upstream' into merge
andyfriesen Aug 4, 2023
63d9e3e
Smaller recursion limit for NoOpt in the failing test
vegorov-rbx Aug 4, 2023
089da9e
Sync to upstream/release/590
vegorov-rbx Aug 11, 2023
d841a32
Merge branch 'master' into merge
vegorov-rbx Aug 11, 2023
50571a7
Merge branch 'upstream' into merge
vegorov-rbx Aug 11, 2023
433d966
Sync to upstream/release/591
andyfriesen Aug 18, 2023
434e618
Merge branch 'master' into merge
andyfriesen Aug 18, 2023
bdc2f69
Merge branch 'upstream' into merge
andyfriesen Aug 18, 2023
a811050
Sync to upstream/release/592
vegorov-rbx Aug 25, 2023
263c282
Merge branch 'master' into merge
vegorov-rbx Aug 25, 2023
8cf1343
Merge branch 'upstream' into merge
vegorov-rbx Aug 25, 2023
51d4d18
Late fixes
vegorov-rbx Aug 25, 2023
397dbb1
Sync to upstream/release/593
AmaranthineCodices Sep 1, 2023
a2df595
Merge branch 'master' into merge
AmaranthineCodices Sep 1, 2023
09fdb4c
Merge branch 'upstream' into merge
AmaranthineCodices Sep 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Analysis/include/Luau/Metamethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static const std::unordered_map<AstExprBinary::Op, const char*> kBinaryOpMetamet
{AstExprBinary::Op::Sub, "__sub"},
{AstExprBinary::Op::Mul, "__mul"},
{AstExprBinary::Op::Div, "__div"},
{AstExprBinary::Op::FloorDiv, "__idiv"},
{AstExprBinary::Op::Pow, "__pow"},
{AstExprBinary::Op::Mod, "__mod"},
{AstExprBinary::Op::Concat, "__concat"},
Expand Down
18 changes: 17 additions & 1 deletion Analysis/include/Luau/Subtyping.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#pragma once

#include "Luau/Type.h"
#include "Luau/TypePack.h"
#include "Luau/UnifierSharedState.h"

#include <vector>
Expand All @@ -14,8 +15,10 @@ template<typename A, typename B>
struct TryPair;
struct InternalErrorReporter;

class TypeIds;
class Normalizer;
struct NormalizedType;
struct NormalizedClassType;

struct SubtypingResult
{
Expand All @@ -30,6 +33,8 @@ struct SubtypingResult
void andAlso(const SubtypingResult& other);
void orElse(const SubtypingResult& other);

// Only negates the `isSubtype`.
static SubtypingResult negate(const SubtypingResult& result);
static SubtypingResult all(const std::vector<SubtypingResult>& results);
static SubtypingResult any(const std::vector<SubtypingResult>& results);
};
Expand Down Expand Up @@ -63,7 +68,7 @@ struct Subtyping
DenseHashMap<TypePackId, TypePackId> mappedGenericPacks{nullptr};

using SeenSet = std::unordered_set<std::pair<TypeId, TypeId>, TypeIdPairHash>;

SeenSet seenTypes;

// TODO cache
Expand All @@ -88,8 +93,19 @@ struct Subtyping
SubtypingResult isSubtype_(const SingletonType* subSingleton, const PrimitiveType* superPrim);
SubtypingResult isSubtype_(const SingletonType* subSingleton, const SingletonType* superSingleton);
SubtypingResult isSubtype_(const TableType* subTable, const TableType* superTable);
SubtypingResult isSubtype_(const MetatableType* subMt, const MetatableType* superMt);
SubtypingResult isSubtype_(const MetatableType* subMt, const TableType* superTable);
SubtypingResult isSubtype_(const ClassType* subClass, const ClassType* superClass);
SubtypingResult isSubtype_(const ClassType* subClass, const TableType* superTable); // Actually a class <: shape.
SubtypingResult isSubtype_(const FunctionType* subFunction, const FunctionType* superFunction);
SubtypingResult isSubtype_(const PrimitiveType* subPrim, const TableType* superTable);
SubtypingResult isSubtype_(const SingletonType* subSingleton, const TableType* superTable);

SubtypingResult isSubtype_(const NormalizedType* subNorm, const NormalizedType* superNorm);
SubtypingResult isSubtype_(const NormalizedClassType& subClass, const NormalizedClassType& superClass, const TypeIds& superTables);
SubtypingResult isSubtype_(const TypeIds& subTypes, const TypeIds& superTypes);

SubtypingResult isSubtype_(const VariadicTypePack* subVariadic, const VariadicTypePack* superVariadic);

bool bindGeneric(TypeId subTp, TypeId superTp);
bool bindGeneric(TypePackId subTp, TypePackId superTp);
Expand Down
7 changes: 7 additions & 0 deletions Analysis/src/AstJsonEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <math.h>

LUAU_FASTFLAG(LuauFloorDivision)

namespace Luau
{

Expand Down Expand Up @@ -514,6 +516,9 @@ struct AstJsonEncoder : public AstVisitor
return writeString("Mul");
case AstExprBinary::Div:
return writeString("Div");
case AstExprBinary::FloorDiv:
LUAU_ASSERT(FFlag::LuauFloorDivision);
return writeString("FloorDiv");
case AstExprBinary::Mod:
return writeString("Mod");
case AstExprBinary::Pow:
Expand All @@ -536,6 +541,8 @@ struct AstJsonEncoder : public AstVisitor
return writeString("And");
case AstExprBinary::Or:
return writeString("Or");
default:
LUAU_ASSERT(!"Unknown Op");
}
}

Expand Down
14 changes: 10 additions & 4 deletions Analysis/src/Autocomplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
LUAU_FASTFLAG(DebugLuauReadWriteProperties)
LUAU_FASTFLAGVARIABLE(LuauAnonymousAutofilled1, false);
LUAU_FASTFLAGVARIABLE(LuauAutocompleteLastTypecheck, false)
LUAU_FASTFLAGVARIABLE(LuauAutocompleteDoEnd, false)
LUAU_FASTFLAGVARIABLE(LuauAutocompleteStringLiteralBounds, false);

static const std::unordered_set<std::string> kStatementStartingKeywords = {
Expand Down Expand Up @@ -1089,14 +1090,19 @@ static AutocompleteEntryMap autocompleteStatement(
{
if (AstStatForIn* statForIn = (*it)->as<AstStatForIn>(); statForIn && !statForIn->hasEnd)
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword});
if (AstStatFor* statFor = (*it)->as<AstStatFor>(); statFor && !statFor->hasEnd)
else if (AstStatFor* statFor = (*it)->as<AstStatFor>(); statFor && !statFor->hasEnd)
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword});
if (AstStatIf* statIf = (*it)->as<AstStatIf>(); statIf && !statIf->hasEnd)
else if (AstStatIf* statIf = (*it)->as<AstStatIf>(); statIf && !statIf->hasEnd)
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword});
if (AstStatWhile* statWhile = (*it)->as<AstStatWhile>(); statWhile && !statWhile->hasEnd)
else if (AstStatWhile* statWhile = (*it)->as<AstStatWhile>(); statWhile && !statWhile->hasEnd)
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword});
if (AstExprFunction* exprFunction = (*it)->as<AstExprFunction>(); exprFunction && !exprFunction->hasEnd)
else if (AstExprFunction* exprFunction = (*it)->as<AstExprFunction>(); exprFunction && !exprFunction->hasEnd)
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword});
if (FFlag::LuauAutocompleteDoEnd)
{
if (AstStatBlock* exprBlock = (*it)->as<AstStatBlock>(); exprBlock && !exprBlock->hasEnd)
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword});
}
}

if (ancestry.size() >= 2)
Expand Down
4 changes: 3 additions & 1 deletion Analysis/src/ConstraintGraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ LUAU_FASTINT(LuauCheckRecursionLimit);
LUAU_FASTFLAG(DebugLuauLogSolverToJson);
LUAU_FASTFLAG(DebugLuauMagicTypes);
LUAU_FASTFLAG(LuauParseDeclareClassIndexer);
LUAU_FASTFLAG(LuauFloorDivision);

namespace Luau
{
Expand Down Expand Up @@ -1170,7 +1171,8 @@ static bool isMetamethod(const Name& name)
{
return name == "__index" || name == "__newindex" || name == "__call" || name == "__concat" || name == "__unm" || name == "__add" ||
name == "__sub" || name == "__mul" || name == "__div" || name == "__mod" || name == "__pow" || name == "__tostring" ||
name == "__metatable" || name == "__eq" || name == "__lt" || name == "__le" || name == "__mode" || name == "__iter" || name == "__len";
name == "__metatable" || name == "__eq" || name == "__lt" || name == "__le" || name == "__mode" || name == "__iter" || name == "__len" ||
(FFlag::LuauFloorDivision && name == "__idiv");
}

ControlFlow ConstraintGraphBuilder::visit(const ScopePtr& scope, AstStatDeclareClass* declaredClass)
Expand Down
6 changes: 6 additions & 0 deletions Analysis/src/ConstraintSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "Luau/VisitType.h"

LUAU_FASTFLAGVARIABLE(DebugLuauLogSolver, false);
LUAU_FASTFLAG(LuauFloorDivision);

namespace Luau
{
Expand Down Expand Up @@ -719,6 +720,8 @@ bool ConstraintSolver::tryDispatch(const BinaryConstraint& c, NotNull<const Cons
// Metatables go first, even if there is primitive behavior.
if (auto it = kBinaryOpMetamethods.find(c.op); it != kBinaryOpMetamethods.end())
{
LUAU_ASSERT(FFlag::LuauFloorDivision || c.op != AstExprBinary::Op::FloorDiv);

// Metatables are not the same. The metamethod will not be invoked.
if ((c.op == AstExprBinary::Op::CompareEq || c.op == AstExprBinary::Op::CompareNe) &&
getMetatable(leftType, builtinTypes) != getMetatable(rightType, builtinTypes))
Expand Down Expand Up @@ -806,9 +809,12 @@ bool ConstraintSolver::tryDispatch(const BinaryConstraint& c, NotNull<const Cons
case AstExprBinary::Op::Sub:
case AstExprBinary::Op::Mul:
case AstExprBinary::Op::Div:
case AstExprBinary::Op::FloorDiv:
case AstExprBinary::Op::Pow:
case AstExprBinary::Op::Mod:
{
LUAU_ASSERT(FFlag::LuauFloorDivision || c.op != AstExprBinary::Op::FloorDiv);

const NormalizedType* normLeftTy = normalizer->normalize(leftType);
if (hasTypeInIntersection<FreeType>(leftType) && force)
asMutable(leftType)->ty.emplace<BoundType>(anyPresent ? builtinTypes->anyType : builtinTypes->numberType);
Expand Down
22 changes: 4 additions & 18 deletions Analysis/src/Error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <stdexcept>
#include <type_traits>

LUAU_FASTFLAGVARIABLE(LuauIndentTypeMismatch, false)
LUAU_FASTINTVARIABLE(LuauIndentTypeMismatchMaxTypeLength, 10)

static std::string wrongNumberOfArgsString(
Expand Down Expand Up @@ -94,39 +93,26 @@ struct ErrorConverter
{
std::string givenModuleName = fileResolver->getHumanReadableModuleName(*givenDefinitionModule);
std::string wantedModuleName = fileResolver->getHumanReadableModuleName(*wantedDefinitionModule);
if (FFlag::LuauIndentTypeMismatch)
result = constructErrorMessage(givenTypeName, wantedTypeName, givenModuleName, wantedModuleName);
else
result = "Type '" + givenTypeName + "' from '" + givenModuleName + "' could not be converted into '" + wantedTypeName +
"' from '" + wantedModuleName + "'";
result = constructErrorMessage(givenTypeName, wantedTypeName, givenModuleName, wantedModuleName);
}
else
{
if (FFlag::LuauIndentTypeMismatch)
result = constructErrorMessage(givenTypeName, wantedTypeName, *givenDefinitionModule, *wantedDefinitionModule);
else
result = "Type '" + givenTypeName + "' from '" + *givenDefinitionModule + "' could not be converted into '" +
wantedTypeName + "' from '" + *wantedDefinitionModule + "'";
result = constructErrorMessage(givenTypeName, wantedTypeName, *givenDefinitionModule, *wantedDefinitionModule);
}
}
}
}

if (result.empty())
{
if (FFlag::LuauIndentTypeMismatch)
result = constructErrorMessage(givenTypeName, wantedTypeName, std::nullopt, std::nullopt);
else
result = "Type '" + givenTypeName + "' could not be converted into '" + wantedTypeName + "'";
}
result = constructErrorMessage(givenTypeName, wantedTypeName, std::nullopt, std::nullopt);


if (tm.error)
{
result += "\ncaused by:\n ";

if (!tm.reason.empty())
result += tm.reason + (FFlag::LuauIndentTypeMismatch ? " \n" : " ");
result += tm.reason + " \n";

result += Luau::toString(*tm.error, TypeErrorToStringOptions{fileResolver});
}
Expand Down
Loading