mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Remove asserts the types already cover
The nil check burn down added guards which turned out redundant once the surrounding annotations landed. `_has_handlers` is set to true when the first handler registers, so it is a boolean rather than the literal false it was inferred as. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -165,7 +165,7 @@ Elements.container = Gui.define("container")
|
||||
--- @param container LuaGuiElement
|
||||
--- @return LuaGuiElement
|
||||
function Elements.container.get_root_element(container)
|
||||
return container.parent
|
||||
return assert(container.parent)
|
||||
end
|
||||
|
||||
--- A frame within a container
|
||||
@@ -319,14 +319,15 @@ Elements.screen_frame = Gui.define("screen_frame")
|
||||
--- @param screen_frame LuaGuiElement
|
||||
--- @return LuaGuiElement
|
||||
function Elements.screen_frame.get_button_flow(screen_frame)
|
||||
return (assert(Elements.screen_frame.data[screen_frame.parent], "Screen frame has no button flow"))
|
||||
local value = assert(Elements.screen_frame.data[assert(screen_frame.parent)], "Screen frame has no button flow")
|
||||
return value
|
||||
end
|
||||
|
||||
--- Get the root element of a screen frame
|
||||
--- @param screen_frame LuaGuiElement
|
||||
--- @return LuaGuiElement
|
||||
function Elements.screen_frame.get_root_element(screen_frame)
|
||||
return screen_frame.parent
|
||||
return assert(screen_frame.parent)
|
||||
end
|
||||
|
||||
return Elements
|
||||
|
||||
Reference in New Issue
Block a user