Skip to content

Type safety / static async check #22

@fed239

Description

@fed239

Would it possible to do so that when @async is used with a function, its type is change, so if @await is not used when calling the function type checking would fail?

Example

@async function returnZero(): Int {
  return 0;
}

var i: Int = @await returnZero(); // compilation succeeds
var p: Promise<Int> = returnZero(); // compilation succeeds
var i2: Int = returnZero(); // compilation fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions