Skip to content

功能请求:支持根据调用方式推理出函数参数的类型 #2266

@mercury233

Description

@mercury233

例:https://github.com/mercury233/lua-test

现有一个在外部实现的DOG

image

SetOnPetting的参数是一个函数,用于执行这只狗被摸时的操作,这个函数的原型已经通过---@param 定义

但下面这样写,不能推导出dogBark和dogMeow的参数类型

image

image
image

只有写成inline函数才行
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    as designedFunctioning as intended, will not be modifiedquestionUser has a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions