Skip to content

bad type narrow with type() #696

Closed
Closed

Description

@lewis6991
Image
local ty --- @type type|fun(x:any): boolean

--- @param _ty fun(v:any):boolean
local function validate(_ty) end

if type(ty) == 'function' then
  validate(ty)
end

Changing type|fun(x:any): boolean to string|fun(x:any): boolean doesn't have the problem.

Activity

  1. added theissue type on Aug 8, 2025
  2. added 2 commits that reference this issue on Feb 6, 2026
    61abf7c
    0a4dc64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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