Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always pass declaration to resolve_decl_into_nominal #889

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading