Skip to content

分析异常 #296

@xuhuanzy

Description

@xuhuanzy

分析异常

    ---@diagnostic disable-next-line: missing-return
    ---@generic T
    ---@param table table
    ---@param metatable {__index: T}
    ---@return T
    local function abc(table, metatable) end
    
    
    ---@class B
    local B
    
    --- @return B
    function newB()
        -- abc() 先于 __index = B 分析, 导致 self 为 Unknown
        local self = abc({}, { __index = B }) 
        self:notmethod() -- 应该报错
        return self
    end

Metadata

Metadata

Assignees

No one assigned

    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