ws-docs: examples/cad.luau: typed tables (no new type diagnostic)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
e74aef06ee
commit
b5d3d68dd3
1 file changed
+2
-2
+2
-2
@@ -29,12 +29,12 @@ local step = assert(F.format("step"))
|
|||||||
print(string.format("schema %s, %d instances, file %s", cad.schema, cad.meta.count, cad.header.FILE_NAME[1]))
|
print(string.format("schema %s, %d instances, file %s", cad.schema, cad.meta.count, cad.header.FILE_NAME[1]))
|
||||||
|
|
||||||
-- count instances per type
|
-- count instances per type
|
||||||
local counts = {}
|
local counts: { [string]: number } = {}
|
||||||
for _, id in step.ids(cad) do
|
for _, id in step.ids(cad) do
|
||||||
local t = cad.entities[id].type
|
local t = cad.entities[id].type
|
||||||
counts[t] = (counts[t] or 0) + 1
|
counts[t] = (counts[t] or 0) + 1
|
||||||
end
|
end
|
||||||
local types = {}
|
local types: { string } = {}
|
||||||
for t in counts do
|
for t in counts do
|
||||||
table.insert(types, t)
|
table.insert(types, t)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user