mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 06:15:44 +08:00
ea14e65ea0
# What's changed? * Compiler now targets bytecode version 5 by default, this includes support for vector type literals and sub/div opcodes with a constant on lhs ### New Type Solver * Normalizer type inhabitance check has been optimized * Added ability to reduce cyclic `and`/`or` type families ### Native Code Generation * `CodeGen::compile` now returns more specific causes of a code generation failure * Fixed linking issues on platforms that don't support unwind frame data registration --- ### Internal Contributors Co-authored-by: Andy Friesen <afriesen@roblox.com> Co-authored-by: Aviral Goel <agoel@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: 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>
47 lines
1014 B
C++
47 lines
1014 B
C++
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
#pragma once
|
|
|
|
#include "Luau/Differ.h"
|
|
#include "Luau/TypeFwd.h"
|
|
|
|
#include "doctest.h"
|
|
|
|
#include <string>
|
|
#include <type_traits>
|
|
|
|
namespace Luau
|
|
{
|
|
|
|
std::string toString(const DifferResult& result);
|
|
|
|
template<typename L, typename R>
|
|
std::string diff(L, R)
|
|
{
|
|
return "<undiffable>";
|
|
}
|
|
|
|
template<>
|
|
std::string diff<TypeId, TypeId>(TypeId l, TypeId r);
|
|
|
|
template<>
|
|
std::string diff<const Type&, const Type&>(const Type& l, const Type& r);
|
|
|
|
} // namespace Luau
|
|
|
|
// Note: the do-while blocks in the macros below is to scope the INFO block to
|
|
// only that assertion.
|
|
|
|
#define CHECK_EQ_DIFF(l, r) \
|
|
do \
|
|
{ \
|
|
INFO("Left and right values were not equal: ", diff(l, r)); \
|
|
CHECK_EQ(l, r); \
|
|
} while (false);
|
|
|
|
#define REQUIRE_EQ_DIFF(l, r) \
|
|
do \
|
|
{ \
|
|
INFO("Left and right values were not equal: ", diff(l, r)); \
|
|
REQUIRE_EQ(l, r); \
|
|
} while (false);
|