Skip to content

能否提供一个新的助记符never或者noreturn #1484

Description

@fesily

用来标记该函数是抛出异常,永远不返回.

当前内建只支持了函数error

typescript keyword never

function fail(message: string): never {
  throw new Error(message);
}

or c++ attributue noreturn

[[ noreturn ]] void f() {
  throw "error";
}

so, lua maybe like:

---@noreturn
---@never
local function h()end

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions