Skip to content

wrong type from if-else block #824

@phanen

Description

@phanen
local a
local f = function()
  if a > 1 then
    return 1
  else
    return 2
  end
end

local b = f()
assert(b)

Expected: b is always truthy
Actual: (1|2)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions