2021-10-30 04:25:12 +08:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
2022-04-08 05:29:01 +08:00
|
|
|
#include "Luau/Clone.h"
|
2021-10-30 04:25:12 +08:00
|
|
|
#include "Luau/Module.h"
|
2021-11-05 10:34:35 +08:00
|
|
|
#include "Luau/Scope.h"
|
2022-04-15 07:57:43 +08:00
|
|
|
#include "Luau/RecursionCounter.h"
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
#include "Fixture.h"
|
|
|
|
|
|
|
|
#include "doctest.h"
|
|
|
|
|
|
|
|
using namespace Luau;
|
|
|
|
|
2022-09-09 06:14:25 +08:00
|
|
|
LUAU_FASTFLAG(DebugLuauDeferredConstraintResolution);
|
2022-04-15 07:57:43 +08:00
|
|
|
|
2021-10-30 04:25:12 +08:00
|
|
|
TEST_SUITE_BEGIN("ModuleTests");
|
|
|
|
|
|
|
|
TEST_CASE_FIXTURE(Fixture, "is_within_comment")
|
|
|
|
{
|
|
|
|
check(R"(
|
|
|
|
--!strict
|
|
|
|
local foo = {}
|
|
|
|
function foo:bar() end
|
|
|
|
|
|
|
|
--[[
|
|
|
|
foo:
|
|
|
|
]] foo:bar()
|
|
|
|
|
|
|
|
--[[]]--[[]] -- Two distinct comments that have zero characters of space between them.
|
|
|
|
)");
|
|
|
|
|
|
|
|
SourceModule* sm = getMainSourceModule();
|
|
|
|
|
|
|
|
CHECK_EQ(5, sm->commentLocations.size());
|
|
|
|
|
|
|
|
CHECK(isWithinComment(*sm, Position{1, 15}));
|
|
|
|
CHECK(isWithinComment(*sm, Position{6, 16}));
|
|
|
|
CHECK(isWithinComment(*sm, Position{9, 13}));
|
|
|
|
CHECK(isWithinComment(*sm, Position{9, 14}));
|
|
|
|
|
|
|
|
CHECK(!isWithinComment(*sm, Position{2, 15}));
|
|
|
|
CHECK(!isWithinComment(*sm, Position{7, 10}));
|
|
|
|
CHECK(!isWithinComment(*sm, Position{7, 11}));
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE_FIXTURE(Fixture, "dont_clone_persistent_primitive")
|
|
|
|
{
|
|
|
|
TypeArena dest;
|
2021-12-03 14:41:04 +08:00
|
|
|
CloneState cloneState;
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
// numberType is persistent. We leave it as-is.
|
2022-04-15 07:57:43 +08:00
|
|
|
TypeId newNumber = clone(typeChecker.numberType, dest, cloneState);
|
2021-10-30 04:25:12 +08:00
|
|
|
CHECK_EQ(newNumber, typeChecker.numberType);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE_FIXTURE(Fixture, "deepClone_non_persistent_primitive")
|
|
|
|
{
|
|
|
|
TypeArena dest;
|
2021-12-03 14:41:04 +08:00
|
|
|
CloneState cloneState;
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
// Create a new number type that isn't persistent
|
|
|
|
unfreeze(typeChecker.globalTypes);
|
2023-01-05 04:53:17 +08:00
|
|
|
TypeId oldNumber = typeChecker.globalTypes.addType(PrimitiveType{PrimitiveType::Number});
|
2021-10-30 04:25:12 +08:00
|
|
|
freeze(typeChecker.globalTypes);
|
2022-04-15 07:57:43 +08:00
|
|
|
TypeId newNumber = clone(oldNumber, dest, cloneState);
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
CHECK_NE(newNumber, oldNumber);
|
|
|
|
CHECK_EQ(*oldNumber, *newNumber);
|
|
|
|
CHECK_EQ("number", toString(newNumber));
|
2023-01-05 04:53:17 +08:00
|
|
|
CHECK_EQ(1, dest.types.size());
|
2021-10-30 04:25:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE_FIXTURE(Fixture, "deepClone_cyclic_table")
|
|
|
|
{
|
|
|
|
CheckResult result = check(R"(
|
|
|
|
local Cyclic = {}
|
|
|
|
function Cyclic.get()
|
|
|
|
return Cyclic
|
|
|
|
end
|
|
|
|
)");
|
|
|
|
|
|
|
|
LUAU_REQUIRE_NO_ERRORS(result);
|
|
|
|
|
|
|
|
/* The inferred type of Cyclic is {get: () -> Cyclic}
|
|
|
|
*
|
|
|
|
* Assert that the return type of get() is the same as the outer table.
|
|
|
|
*/
|
|
|
|
|
|
|
|
TypeId counterType = requireType("Cyclic");
|
|
|
|
|
|
|
|
TypeArena dest;
|
2022-04-15 07:57:43 +08:00
|
|
|
CloneState cloneState;
|
|
|
|
TypeId counterCopy = clone(counterType, dest, cloneState);
|
2021-10-30 04:25:12 +08:00
|
|
|
|
2023-01-05 04:53:17 +08:00
|
|
|
TableType* ttv = getMutable<TableType>(counterCopy);
|
2021-10-30 04:25:12 +08:00
|
|
|
REQUIRE(ttv != nullptr);
|
|
|
|
|
|
|
|
CHECK_EQ(std::optional<std::string>{"Cyclic"}, ttv->syntheticName);
|
|
|
|
|
|
|
|
TypeId methodType = ttv->props["get"].type;
|
|
|
|
REQUIRE(methodType != nullptr);
|
|
|
|
|
2023-01-05 04:53:17 +08:00
|
|
|
const FunctionType* ftv = get<FunctionType>(methodType);
|
2021-10-30 04:25:12 +08:00
|
|
|
REQUIRE(ftv != nullptr);
|
|
|
|
|
2022-06-17 09:05:14 +08:00
|
|
|
std::optional<TypeId> methodReturnType = first(ftv->retTypes);
|
2021-10-30 04:25:12 +08:00
|
|
|
REQUIRE(methodReturnType);
|
|
|
|
|
|
|
|
CHECK_EQ(methodReturnType, counterCopy);
|
2022-10-15 03:48:41 +08:00
|
|
|
CHECK_EQ(2, dest.typePacks.size()); // one for the function args, and another for its return type
|
2023-01-05 04:53:17 +08:00
|
|
|
CHECK_EQ(2, dest.types.size()); // One table and one function
|
2021-10-30 04:25:12 +08:00
|
|
|
}
|
|
|
|
|
2022-05-14 03:36:37 +08:00
|
|
|
TEST_CASE_FIXTURE(BuiltinsFixture, "builtin_types_point_into_globalTypes_arena")
|
2021-10-30 04:25:12 +08:00
|
|
|
{
|
2023-01-07 05:14:35 +08:00
|
|
|
ScopedFastFlag luauScopelessModule{"LuauScopelessModule", true};
|
|
|
|
|
2021-10-30 04:25:12 +08:00
|
|
|
CheckResult result = check(R"(
|
|
|
|
return {sign=math.sign}
|
|
|
|
)");
|
|
|
|
dumpErrors(result);
|
|
|
|
LUAU_REQUIRE_NO_ERRORS(result);
|
|
|
|
|
|
|
|
ModulePtr module = frontend.moduleResolver.getModule("MainModule");
|
2023-01-07 05:14:35 +08:00
|
|
|
std::optional<TypeId> exports = first(module->returnType);
|
2021-10-30 04:25:12 +08:00
|
|
|
REQUIRE(bool(exports));
|
|
|
|
|
|
|
|
REQUIRE(isInArena(*exports, module->interfaceTypes));
|
|
|
|
|
2023-01-05 04:53:17 +08:00
|
|
|
TableType* exportsTable = getMutable<TableType>(*exports);
|
2021-10-30 04:25:12 +08:00
|
|
|
REQUIRE(exportsTable != nullptr);
|
|
|
|
|
|
|
|
TypeId signType = exportsTable->props["sign"].type;
|
|
|
|
REQUIRE(signType != nullptr);
|
|
|
|
|
|
|
|
CHECK(!isInArena(signType, module->interfaceTypes));
|
2022-09-09 06:14:25 +08:00
|
|
|
if (FFlag::DebugLuauDeferredConstraintResolution)
|
|
|
|
CHECK(isInArena(signType, frontend.globalTypes));
|
|
|
|
else
|
|
|
|
CHECK(isInArena(signType, typeChecker.globalTypes));
|
2021-10-30 04:25:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE_FIXTURE(Fixture, "deepClone_union")
|
|
|
|
{
|
|
|
|
TypeArena dest;
|
2021-12-03 14:41:04 +08:00
|
|
|
CloneState cloneState;
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
unfreeze(typeChecker.globalTypes);
|
2023-01-05 04:53:17 +08:00
|
|
|
TypeId oldUnion = typeChecker.globalTypes.addType(UnionType{{typeChecker.numberType, typeChecker.stringType}});
|
2021-10-30 04:25:12 +08:00
|
|
|
freeze(typeChecker.globalTypes);
|
2022-04-15 07:57:43 +08:00
|
|
|
TypeId newUnion = clone(oldUnion, dest, cloneState);
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
CHECK_NE(newUnion, oldUnion);
|
|
|
|
CHECK_EQ("number | string", toString(newUnion));
|
2023-01-05 04:53:17 +08:00
|
|
|
CHECK_EQ(1, dest.types.size());
|
2021-10-30 04:25:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE_FIXTURE(Fixture, "deepClone_intersection")
|
|
|
|
{
|
|
|
|
TypeArena dest;
|
2021-12-03 14:41:04 +08:00
|
|
|
CloneState cloneState;
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
unfreeze(typeChecker.globalTypes);
|
2023-01-05 04:53:17 +08:00
|
|
|
TypeId oldIntersection = typeChecker.globalTypes.addType(IntersectionType{{typeChecker.numberType, typeChecker.stringType}});
|
2021-10-30 04:25:12 +08:00
|
|
|
freeze(typeChecker.globalTypes);
|
2022-04-15 07:57:43 +08:00
|
|
|
TypeId newIntersection = clone(oldIntersection, dest, cloneState);
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
CHECK_NE(newIntersection, oldIntersection);
|
|
|
|
CHECK_EQ("number & string", toString(newIntersection));
|
2023-01-05 04:53:17 +08:00
|
|
|
CHECK_EQ(1, dest.types.size());
|
2021-10-30 04:25:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE_FIXTURE(Fixture, "clone_class")
|
|
|
|
{
|
2023-01-05 04:53:17 +08:00
|
|
|
Type exampleMetaClass{ClassType{"ExampleClassMeta",
|
2021-10-30 04:25:12 +08:00
|
|
|
{
|
|
|
|
{"__add", {typeChecker.anyType}},
|
|
|
|
},
|
2022-04-22 05:44:27 +08:00
|
|
|
std::nullopt, std::nullopt, {}, {}, "Test"}};
|
2023-01-05 04:53:17 +08:00
|
|
|
Type exampleClass{ClassType{"ExampleClass",
|
2021-10-30 04:25:12 +08:00
|
|
|
{
|
|
|
|
{"PropOne", {typeChecker.numberType}},
|
|
|
|
{"PropTwo", {typeChecker.stringType}},
|
|
|
|
},
|
2022-04-22 05:44:27 +08:00
|
|
|
std::nullopt, &exampleMetaClass, {}, {}, "Test"}};
|
2021-10-30 04:25:12 +08:00
|
|
|
|
|
|
|
TypeArena dest;
|
2021-12-03 14:41:04 +08:00
|
|
|
CloneState cloneState;
|
2021-10-30 04:25:12 +08:00
|
|
|
|
2022-04-15 07:57:43 +08:00
|
|
|
TypeId cloned = clone(&exampleClass, dest, cloneState);
|
2023-01-05 04:53:17 +08:00
|
|
|
const ClassType* ctv = get<ClassType>(cloned);
|
2021-10-30 04:25:12 +08:00
|
|
|
REQUIRE(ctv != nullptr);
|
|
|
|
|
|
|
|
REQUIRE(ctv->metatable);
|
2023-01-05 04:53:17 +08:00
|
|
|
const ClassType* metatable = get<ClassType>(*ctv->metatable);
|
2021-10-30 04:25:12 +08:00
|
|
|
REQUIRE(metatable);
|
|
|
|
|
|
|
|
CHECK_EQ("ExampleClass", ctv->name);
|
|
|
|
CHECK_EQ("ExampleClassMeta", metatable->name);
|
|
|
|
}
|
|
|
|
|
2022-04-22 05:44:27 +08:00
|
|
|
TEST_CASE_FIXTURE(Fixture, "clone_free_types")
|
2021-10-30 04:25:12 +08:00
|
|
|
{
|
2023-01-05 04:53:17 +08:00
|
|
|
Type freeTy(FreeType{TypeLevel{}});
|
2021-10-30 04:25:12 +08:00
|
|
|
TypePackVar freeTp(FreeTypePack{TypeLevel{}});
|
|
|
|
|
|
|
|
TypeArena dest;
|
2021-12-03 14:41:04 +08:00
|
|
|
CloneState cloneState;
|
2021-10-30 04:25:12 +08:00
|
|
|
|
2022-04-15 07:57:43 +08:00
|
|
|
TypeId clonedTy = clone(&freeTy, dest, cloneState);
|
2023-01-05 04:53:17 +08:00
|
|
|
CHECK(get<FreeType>(clonedTy));
|
2021-10-30 04:25:12 +08:00
|
|
|
|
2021-12-03 14:41:04 +08:00
|
|
|
cloneState = {};
|
2022-04-15 07:57:43 +08:00
|
|
|
TypePackId clonedTp = clone(&freeTp, dest, cloneState);
|
2022-04-22 05:44:27 +08:00
|
|
|
CHECK(get<FreeTypePack>(clonedTp));
|
2021-10-30 04:25:12 +08:00
|
|
|
}
|
|
|
|
|
2022-04-22 05:44:27 +08:00
|
|
|
TEST_CASE_FIXTURE(Fixture, "clone_free_tables")
|
2021-10-30 04:25:12 +08:00
|
|
|
{
|
2023-01-05 04:53:17 +08:00
|
|
|
Type tableTy{TableType{}};
|
|
|
|
TableType* ttv = getMutable<TableType>(&tableTy);
|
2021-10-30 04:25:12 +08:00
|
|
|
ttv->state = TableState::Free;
|
|
|
|
|
|
|
|
TypeArena dest;
|
2021-12-03 14:41:04 +08:00
|
|
|
CloneState cloneState;
|
2021-10-30 04:25:12 +08:00
|
|
|
|
2022-04-15 07:57:43 +08:00
|
|
|
TypeId cloned = clone(&tableTy, dest, cloneState);
|
2023-01-05 04:53:17 +08:00
|
|
|
const TableType* clonedTtv = get<TableType>(cloned);
|
2022-04-22 05:44:27 +08:00
|
|
|
CHECK_EQ(clonedTtv->state, TableState::Free);
|
2021-10-30 04:25:12 +08:00
|
|
|
}
|
|
|
|
|
2022-05-14 03:36:37 +08:00
|
|
|
TEST_CASE_FIXTURE(BuiltinsFixture, "clone_self_property")
|
2021-10-30 04:25:12 +08:00
|
|
|
{
|
|
|
|
fileResolver.source["Module/A"] = R"(
|
|
|
|
--!nonstrict
|
|
|
|
local a = {}
|
2022-03-18 08:46:04 +08:00
|
|
|
function a:foo(x: number)
|
2021-10-30 04:25:12 +08:00
|
|
|
return -x;
|
|
|
|
end
|
|
|
|
return a;
|
|
|
|
)";
|
|
|
|
|
|
|
|
CheckResult result = frontend.check("Module/A");
|
|
|
|
LUAU_REQUIRE_NO_ERRORS(result);
|
|
|
|
|
|
|
|
fileResolver.source["Module/B"] = R"(
|
|
|
|
--!nonstrict
|
|
|
|
local a = require(script.Parent.A)
|
|
|
|
return a.foo(5)
|
|
|
|
)";
|
|
|
|
|
|
|
|
result = frontend.check("Module/B");
|
|
|
|
|
2022-03-18 08:46:04 +08:00
|
|
|
LUAU_REQUIRE_ERROR_COUNT(1, result);
|
|
|
|
|
|
|
|
CHECK_EQ("This function must be called with self. Did you mean to use a colon instead of a dot?", toString(result.errors[0]));
|
2021-10-30 04:25:12 +08:00
|
|
|
}
|
|
|
|
|
2021-12-03 14:41:04 +08:00
|
|
|
TEST_CASE_FIXTURE(Fixture, "clone_recursion_limit")
|
|
|
|
{
|
|
|
|
#if defined(_DEBUG) || defined(_NOOPT)
|
|
|
|
int limit = 250;
|
|
|
|
#else
|
|
|
|
int limit = 400;
|
|
|
|
#endif
|
|
|
|
ScopedFastInt luauTypeCloneRecursionLimit{"LuauTypeCloneRecursionLimit", limit};
|
|
|
|
|
|
|
|
TypeArena src;
|
|
|
|
|
2023-01-05 04:53:17 +08:00
|
|
|
TypeId table = src.addType(TableType{});
|
2021-12-03 14:41:04 +08:00
|
|
|
TypeId nested = table;
|
|
|
|
|
|
|
|
for (int i = 0; i < limit + 100; i++)
|
|
|
|
{
|
2023-01-05 04:53:17 +08:00
|
|
|
TableType* ttv = getMutable<TableType>(nested);
|
2021-12-03 14:41:04 +08:00
|
|
|
|
2023-01-05 04:53:17 +08:00
|
|
|
ttv->props["a"].type = src.addType(TableType{});
|
2021-12-03 14:41:04 +08:00
|
|
|
nested = ttv->props["a"].type;
|
|
|
|
}
|
|
|
|
|
|
|
|
TypeArena dest;
|
|
|
|
CloneState cloneState;
|
|
|
|
|
2022-12-03 02:09:59 +08:00
|
|
|
CHECK_THROWS_AS(clone(table, dest, cloneState), RecursionLimitException);
|
2021-12-03 14:41:04 +08:00
|
|
|
}
|
|
|
|
|
2022-06-11 00:58:21 +08:00
|
|
|
TEST_CASE_FIXTURE(Fixture, "any_persistance_does_not_leak")
|
|
|
|
{
|
2023-01-07 05:14:35 +08:00
|
|
|
ScopedFastFlag luauScopelessModule{"LuauScopelessModule", true};
|
|
|
|
|
2022-06-11 00:58:21 +08:00
|
|
|
fileResolver.source["Module/A"] = R"(
|
|
|
|
export type A = B
|
|
|
|
type B = A
|
|
|
|
)";
|
|
|
|
|
|
|
|
FrontendOptions opts;
|
|
|
|
opts.retainFullTypeGraphs = false;
|
|
|
|
CheckResult result = frontend.check("Module/A", opts);
|
|
|
|
LUAU_REQUIRE_ERRORS(result);
|
|
|
|
|
|
|
|
auto mod = frontend.moduleResolver.getModule("Module/A");
|
2023-01-07 05:14:35 +08:00
|
|
|
auto it = mod->exportedTypeBindings.find("A");
|
|
|
|
REQUIRE(it != mod->exportedTypeBindings.end());
|
2022-06-11 00:58:21 +08:00
|
|
|
CHECK(toString(it->second.type) == "any");
|
|
|
|
}
|
|
|
|
|
2022-08-12 05:01:33 +08:00
|
|
|
TEST_CASE_FIXTURE(BuiltinsFixture, "do_not_clone_reexports")
|
|
|
|
{
|
|
|
|
ScopedFastFlag flags[] = {
|
|
|
|
{"LuauClonePublicInterfaceLess", true},
|
|
|
|
{"LuauSubstitutionReentrant", true},
|
|
|
|
{"LuauClassTypeVarsInSubstitution", true},
|
|
|
|
{"LuauSubstitutionFixMissingFields", true},
|
2023-01-07 05:14:35 +08:00
|
|
|
{"LuauScopelessModule", true},
|
2022-08-12 05:01:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
fileResolver.source["Module/A"] = R"(
|
|
|
|
export type A = {p : number}
|
|
|
|
return {}
|
|
|
|
)";
|
|
|
|
|
|
|
|
fileResolver.source["Module/B"] = R"(
|
|
|
|
local a = require(script.Parent.A)
|
|
|
|
export type B = {q : a.A}
|
|
|
|
return {}
|
|
|
|
)";
|
|
|
|
|
|
|
|
CheckResult result = frontend.check("Module/B");
|
|
|
|
LUAU_REQUIRE_NO_ERRORS(result);
|
|
|
|
|
|
|
|
ModulePtr modA = frontend.moduleResolver.getModule("Module/A");
|
|
|
|
ModulePtr modB = frontend.moduleResolver.getModule("Module/B");
|
|
|
|
REQUIRE(modA);
|
|
|
|
REQUIRE(modB);
|
2023-01-07 05:14:35 +08:00
|
|
|
auto modAiter = modA->exportedTypeBindings.find("A");
|
|
|
|
auto modBiter = modB->exportedTypeBindings.find("B");
|
|
|
|
REQUIRE(modAiter != modA->exportedTypeBindings.end());
|
|
|
|
REQUIRE(modBiter != modB->exportedTypeBindings.end());
|
2022-08-12 05:01:33 +08:00
|
|
|
TypeId typeA = modAiter->second.type;
|
|
|
|
TypeId typeB = modBiter->second.type;
|
2023-01-05 04:53:17 +08:00
|
|
|
TableType* tableB = getMutable<TableType>(typeB);
|
2022-08-12 05:01:33 +08:00
|
|
|
REQUIRE(tableB);
|
|
|
|
CHECK(typeA == tableB->props["q"].type);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE_FIXTURE(BuiltinsFixture, "do_not_clone_types_of_reexported_values")
|
|
|
|
{
|
|
|
|
ScopedFastFlag flags[] = {
|
|
|
|
{"LuauClonePublicInterfaceLess", true},
|
|
|
|
{"LuauSubstitutionReentrant", true},
|
|
|
|
{"LuauClassTypeVarsInSubstitution", true},
|
|
|
|
{"LuauSubstitutionFixMissingFields", true},
|
2023-01-07 05:14:35 +08:00
|
|
|
{"LuauScopelessModule", true},
|
2022-08-12 05:01:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
fileResolver.source["Module/A"] = R"(
|
|
|
|
local exports = {a={p=5}}
|
|
|
|
return exports
|
|
|
|
)";
|
|
|
|
|
|
|
|
fileResolver.source["Module/B"] = R"(
|
|
|
|
local a = require(script.Parent.A)
|
|
|
|
local exports = {b=a.a}
|
|
|
|
return exports
|
|
|
|
)";
|
|
|
|
|
|
|
|
CheckResult result = frontend.check("Module/B");
|
|
|
|
LUAU_REQUIRE_NO_ERRORS(result);
|
|
|
|
|
|
|
|
ModulePtr modA = frontend.moduleResolver.getModule("Module/A");
|
|
|
|
ModulePtr modB = frontend.moduleResolver.getModule("Module/B");
|
|
|
|
REQUIRE(modA);
|
|
|
|
REQUIRE(modB);
|
2023-01-07 05:14:35 +08:00
|
|
|
std::optional<TypeId> typeA = first(modA->returnType);
|
|
|
|
std::optional<TypeId> typeB = first(modB->returnType);
|
2022-08-12 05:01:33 +08:00
|
|
|
REQUIRE(typeA);
|
|
|
|
REQUIRE(typeB);
|
2023-01-05 04:53:17 +08:00
|
|
|
TableType* tableA = getMutable<TableType>(*typeA);
|
|
|
|
TableType* tableB = getMutable<TableType>(*typeB);
|
2022-08-12 05:01:33 +08:00
|
|
|
CHECK(tableA->props["a"].type == tableB->props["b"].type);
|
|
|
|
}
|
|
|
|
|
2021-10-30 04:25:12 +08:00
|
|
|
TEST_SUITE_END();
|