Skip to content

Commit

Permalink
tests: add regression test for #754
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Aug 21, 2024
1 parent 2bd5357 commit c5c862d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/declaration/local_type_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>
Data: T
end
end
local enum MyEnum
"foo"
"bar"
end
local type MyAlias = MyNamespace.MyGenericRecord<MyEnum>
local t: MyAlias = { Data = "invalid" }
]], {
{ y = 14, msg = 'in record field: Data: string "invalid" is not a member of MyEnum' }
}))
end)

0 comments on commit c5c862d

Please sign in to comment.