Skip to content

overloads in meta files #651

@lewis6991

Description

@lewis6991
--- @meta

--- @param what 'cache'|'config'|'config_dirs'|'data'|'data_dirs'|'log'|'run'|'state'
--- @return string|string[]
function stdpath(what) end

--- @param what 'cache'|'config'|'data'|'log'|'run'|'state'
--- @return string
function stdpath(what) end

--- @param what 'config_dirs'|'data_dirs'
--- @return string[]
function stdpath(what) end

--- @type string
local a = stdpath('cache') -- error (wrong)

--- @type string[]
local b = stdpath('config_dirs') -- error (wrong)

local c = stdpath('config_dirs') .. 'c' -- no error (wrong)

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