mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add test case
This commit is contained in:
parent
ad7d006fb2
commit
e543ad9f27
1 changed files with 20 additions and 0 deletions
|
@ -379,4 +379,24 @@ TEST_CASE_FIXTURE(Fixture, "class_definition_string_props")
|
|||
CHECK_EQ(toString(requireType("y")), "string");
|
||||
}
|
||||
|
||||
TEST_CASE_FIXTURE(Fixture, "class_definitions_reference_other_classes")
|
||||
{
|
||||
unfreeze(typeChecker.globalTypes);
|
||||
LoadDefinitionFileResult result = loadDefinitionFile(typeChecker, typeChecker.globalScope, R"(
|
||||
declare class Channel
|
||||
Messages: { Message }
|
||||
OnMessage: (message: Message) -> ()
|
||||
end
|
||||
|
||||
declare class Message
|
||||
Text: string
|
||||
Channel: Channel
|
||||
end
|
||||
)",
|
||||
"@test");
|
||||
freeze(typeChecker.globalTypes);
|
||||
|
||||
REQUIRE(result.success);
|
||||
}
|
||||
|
||||
TEST_SUITE_END();
|
||||
|
|
Loading…
Add table
Reference in a new issue