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
76bea81a7b
commit
118f6ed3c6
1 changed files with 30 additions and 0 deletions
|
@ -3642,4 +3642,34 @@ end
|
||||||
LUAU_REQUIRE_NO_ERRORS(result);
|
LUAU_REQUIRE_NO_ERRORS(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE_FIXTURE(BuiltinsFixture, "write_common_property_to_table_intersection_1")
|
||||||
|
{
|
||||||
|
|
||||||
|
CheckResult result = check(R"(
|
||||||
|
type Foo = {
|
||||||
|
Bar: string,
|
||||||
|
} & { Baz: number }
|
||||||
|
|
||||||
|
local x: Foo = { Bar = "1", Baz = 2 }
|
||||||
|
local y = x.Bar
|
||||||
|
)");
|
||||||
|
|
||||||
|
LUAU_REQUIRE_NO_ERRORS(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE_FIXTURE(BuiltinsFixture, "write_common_property_to_table_intersection_2")
|
||||||
|
{
|
||||||
|
|
||||||
|
CheckResult result = check(R"(
|
||||||
|
type Foo = {
|
||||||
|
Bar: string,
|
||||||
|
} & { Baz: number }
|
||||||
|
|
||||||
|
local x: Foo = { Bar = "1", Baz = 2 }
|
||||||
|
local y = x["Bar"]
|
||||||
|
)");
|
||||||
|
|
||||||
|
LUAU_REQUIRE_NO_ERRORS(result);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_SUITE_END();
|
TEST_SUITE_END();
|
||||||
|
|
Loading…
Add table
Reference in a new issue