From e297db70811a4ff2b5d0c530e24f2ec22d66b95d 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)