From c5c862d25da7b0dda96d6fe2d359b8e507e8a8dd Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 21 Aug 2024 10:09:59 -0300 Subject: [PATCH] tests: add regression test for #754 --- spec/declaration/local_type_spec.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spec/declaration/local_type_spec.lua b/spec/declaration/local_type_spec.lua index e9c0aa506..59a2c88c2 100644 --- a/spec/declaration/local_type_spec.lua +++ b/spec/declaration/local_type_spec.lua @@ -212,4 +212,23 @@ describe("local type", function() { y = 15, x = 42, msg = 'in record field: first: got string "first", expected integer' }, { y = 15, x = 60, msg = 'in record field: second: got integer, expected string' }, })) + + it("resolves type arguments in nested types correctly (#754)", util.check_type_error([[ + local record MyNamespace + record MyGenericRecord + Data: T + end + end + + local enum MyEnum + "foo" + "bar" + end + + local type MyAlias = MyNamespace.MyGenericRecord + + local t: MyAlias = { Data = "invalid" } + ]], { + { y = 14, msg = 'in record field: Data: string "invalid" is not a member of MyEnum' } + })) end)