diff --git a/spec/lang/subtyping/typealias_spec.lua b/spec/lang/subtyping/typealias_spec.lua index d1362771..2690771c 100644 --- a/spec/lang/subtyping/typealias_spec.lua +++ b/spec/lang/subtyping/typealias_spec.lua @@ -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 + x: T + end + + local record Export + type Test = Generic + end + ]])) end) diff --git a/tl.tl b/tl.tl index 78284162..d4e07eb8 100644 --- a/tl.tl +++ b/tl.tl @@ -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)