Skip to content

Optional Chaining support #938

Description

@felixhirt

Is my assumption correct that Optional chaining does not work / is not supported? Some examples:

let task: IRunnable | undefined;
task?.Execute() ?? error("No Task found to execute");
compiles to
local task
local ____ = task:Execute() or error("No Task found to execute")

let task: IRunnable | undefined;
task?.Execute();
compiles to
local task
task:Execute()

shouldn't it be something like
local _ = task and task:Execute() or error("No Task found to execute")
if task then task:Execute() else error("No Task found to execute") end

Are there plans to support this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions