Skip to content

flow 意外合并类型 #668

@xuhuanzy

Description

@xuhuanzy
---@alias EditorAttrTypeAlias
---| 'ATTR_BASE'
---| 'ATTR_BASE_RATIO'
---| 'ATTR_ALL_RATIO'

---@param attr_element string
function test(attr_element) end

---@param attr_type EditorAttrTypeAlias
function add_attr(attr_type)
    if attr_type ~= 'ATTR_BASE' then
    end
    test(attr_type) -- 预期 `string`,但得到 `(("ATTR_BASE"|"ATTR_BASE_RATIO"...)|"ATTR_BASE")`。 
end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions