Skip to content

Auto require does not work in some case #553

Description

@sumneko

testlib.lua

--- Testlib
local testlib = {}
return testlib

reproduce.lua

local has_function = { f = function () end }

local no_function = { f = true }

-- Doesn't work
do
    local t = has_function[#has_function]
    -- type "t." here
end

-- Works
do
    local t = no_function[#no_function]
    -- type "t." here
end

image

Version: 1.21.2 (Windows)

Originally posted by @Cassolette in #551 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions