Narrow aabb types and give generic aliases their type argument

The aabb functions all index the named members, so passing the
shorthand [MapPosition, MapPosition] form would error at runtime. The
annotations now say so.

emmylua requires a type argument on a generic alias, luals did not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-07 15:31:18 +00:00
co-authored by Claude Opus 5
parent 90f32699c7
commit b9cfbc9036
6 changed files with 48 additions and 43 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ local Async = require("modules/exp_util/async")
local Storage = require("modules/exp_util/storage")
local config = require("modules.exp_legacy.config.compilatron")
--- @type table<string, Async.AsyncReturn>
--- @type table<string, Async.AsyncReturn<any>>
local persistent_locations = {}
Storage.register(persistent_locations, function(tbl)
persistent_locations = tbl
@@ -55,7 +55,7 @@ local speech_bubble_task =
--- @param entity LuaEntity the entity which will have messages spawn from it
--- @param messages LocalisedString[] the messages which should be shown
--- @param starting_index number? the message index to start at, default 1
--- @return Async.AsyncReturn
--- @return Async.AsyncReturn<any>
local function register_entity(entity, messages, starting_index)
return speech_bubble_task{
entity = entity,