Skip to content

Commit

Permalink
fix: always pass declaration to resolve_decl_into_nominal
Browse files Browse the repository at this point in the history
fixes #888
  • Loading branch information
catwell committed Dec 31, 2024
1 parent 43def7f commit 79a3ac9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions spec/lang/subtyping/typealias_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,14 @@ describe("typealias", function()
local type Test = {StringFoo: StringBar}
local test: Test = {}
]]))

it("nested generic type aliases work with early resolution (regression test for #888)", util.check([[
local record Generic<T>
x: T
end
local record Export
type Test = Generic<string>
end
]]))
end)
2 changes: 1 addition & 1 deletion tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -8159,7 +8159,7 @@ do
-- otherwise, this can't be an alias.

-- resolve the nominal into a structural type
local struc = resolve_decl_into_nominal(self, nom, found)
local struc = resolve_decl_into_nominal(self, nom, found or nom.found)

-- wrap it into a new non-alias typedecl
local td = a_type(ta, "typedecl", { def = struc } as TypeDeclType)
Expand Down

0 comments on commit 79a3ac9

Please sign in to comment.