Make the @as casts actually apply

emmylua only parses the inline cast as `--[[@as T]]`, the spaced form
`--[[ @as T ]]` is treated as a plain comment, so all 149 of them were
doing nothing.

LuaGuiElement.style is a union because a style name can be assigned to
it, so reading it back needs the cast.

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 fd2f5a9589
commit 164672602d
32 changed files with 151 additions and 148 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ commands.artillery = Commands.new("artillery", { "exp-commands_artillery.descrip
end
SelectArea:start(player)
return Commands.status.success{ "exp-commands_artillery.enter" }
end) --[[ @as any ]]
end) --[[@as any]]
--- when an area is selected to add protection to the area
SelectArea:on_selection(function(event)
+1 -1
View File
@@ -22,7 +22,7 @@ commands.lawnmower = Commands.new("lawnmower", { "exp-commands_lawnmower.descrip
SelectArea:start(player)
return Commands.status.success{ "exp-commands_lawnmower.enter" }
end) --[[ @as any ]]
end) --[[@as any]]
--- When an area is selected to be handled
SelectArea:on_selection(function(event)
+1 -1
View File
@@ -69,7 +69,7 @@ commands.clear_blueprints = Commands.new("clear-blueprints", { "exp-commands_sur
SelectArea:start(player)
return Commands.status.success{ "exp-commands_surface.enter" }
end) --[[ @as any ]]
end) --[[@as any]]
--- When an area is selected
SelectArea:on_selection(function(event)
+4 -4
View File
@@ -34,7 +34,7 @@ commands.teleport = Commands.new("teleport", { "exp-commands_teleport.descriptio
elseif not teleport_player(other_player, target_player.physical_surface, target_player.physical_position) then
return Commands.status.error{ "exp-commands_teleport.unavailable" }
end
end) --[[ @as any ]]
end) --[[@as any]]
--- Teleports a player to you.
--- @class ExpCommands_Teleport.commands.bring: ExpCommand
@@ -49,7 +49,7 @@ commands.bring = Commands.new("bring", { "exp-commands_teleport.description-brin
elseif not teleport_player(other_player, player.physical_surface, player.physical_position) then
return Commands.status.error{ "exp-commands_teleport.unavailable" }
end
end) --[[ @as any ]]
end) --[[@as any]]
--- Teleports you to a player.
--- @class ExpCommands_Teleport.commands.goto: ExpCommand
@@ -64,7 +64,7 @@ commands["goto"] = Commands.new("goto", { "exp-commands_teleport.description-got
elseif not teleport_player(player, other_player.physical_surface, other_player.physical_position) then
return Commands.status.error{ "exp-commands_teleport.unavailable" }
end
end) --[[ @as any ]]
end) --[[@as any]]
--- Teleport to spawn
--- @class ExpCommands_Teleport.commands.spawn: ExpCommand
@@ -92,7 +92,7 @@ commands.spawn = Commands.new("spawn", { "exp-commands_teleport.description-spaw
else
return Commands.status.unauthorised()
end
end) --[[ @as any ]]
end) --[[@as any]]
return {
commands = commands,
+1 -1
View File
@@ -32,7 +32,7 @@ commands.set_trains_to_automatic = Commands.new("set-trains-to-automatic", { "ex
end
game.print{ "exp-commands_trains.response", format_player_name(player), format_number(#trains, false) }
end) --[[ @as any ]]
end) --[[@as any]]
return {
commands = commands,
+1 -1
View File
@@ -36,7 +36,7 @@ commands.waterfill = Commands.new("waterfill", { "exp-commands_waterfill.descrip
SelectArea:start(player)
return Commands.status.success{ "exp-commands_waterfill.enter" }
end
end) --[[ @as any ]]
end) --[[@as any]]
--- When an area is selected to be converted to water
SelectArea:on_selection(function(event)