---@alias PersonAge ---| integer ---| nil ---@class Person ---@field name string ---@field age PersonAge ---@type Person local person = { name = "123", }
Activity
iamhaiwen commentedon Nov 22, 2025
这个算不算BUG,我在初始化person时给age赋值nil也没问题。
CppCXY commentedon Nov 25, 2025
不改的叫feature, 最好还是显式使用可空, 我们很多阶段都不会直接展开alias, 通常是为了避免无限递归