Skip to content

Commit 09f8174

Browse files
committed
Fix diagnostics for type aliases with the same names as built-in types.
1 parent b125390 commit 09f8174

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

server/script/core/diagnostics/undefined-type.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ return function (uri, callback)
1313
if source[1] == "" then
1414
return
1515
end
16-
if source.parent.type ~= "type.module" and rbxlibs.object[source[1]] then
17-
if source.generics then
18-
callback {
19-
start = source.generics.start,
20-
finish = source.generics.finish,
21-
message = lang.script('TYPE_GENERIC_COUNT', 0, #source.generics)
22-
}
23-
end
24-
return
25-
end
2616
local typeAlias = source.typeAliasGeneric or vm.getTypeAlias(source)
2717
if typeAlias then
2818
if typeAlias.type == "type.genericpack" then
@@ -56,6 +46,16 @@ return function (uri, callback)
5646
}
5747
end
5848
else
49+
if source.parent.type ~= "type.module" and rbxlibs.object[source[1]] then
50+
if source.generics then
51+
callback {
52+
start = source.generics.start,
53+
finish = source.generics.finish,
54+
message = lang.script('TYPE_GENERIC_COUNT', 0, #source.generics)
55+
}
56+
end
57+
return
58+
end
5959
callback {
6060
start = source.start,
6161
finish = source.finish,

0 commit comments

Comments
 (0)