ws-cleanup-types: containers, ops: type the tables and locals the solver cannot infer
This commit is contained in:
1 parent
f209801579
commit
cfe325dcf8
12 files changed
+37
-32
No files matched your search
@@ -45,7 +45,7 @@ local function public(e: Entry): Types.ArchiveEntry
|
||||
end
|
||||
|
||||
function Methods.list(self: any): { Types.ArchiveEntry }
|
||||
local out = table.create(#self._entries)
|
||||
local out = table.create(#self._entries) :: { Types.ArchiveEntry }
|
||||
for i, e in self._entries do
|
||||
out[i] = public(e)
|
||||
end
|
||||
@@ -91,7 +91,7 @@ end
|
||||
|
||||
-- write(opts?) -> buffer | nil, Err: the archive's own format (opts.format is handled by the api)
|
||||
function Methods.write(self: any, opts: any?): (buffer?, Err.Err?)
|
||||
local enc = self._encode
|
||||
local enc: Encoder? = self._encode
|
||||
if not enc then
|
||||
return nil, Err.new(Err.UNSUPPORTED, self.format .. " archives are read-only")
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user