Skip to content

Represent async effects and await sites in TypedProgram #442

Open

Description

@LunaStev

Parent: #439
Depends on: #407, #440, and #441.

Summary

Represent asynchronous effects and await sites in backend-neutral typed HIR.

Scope

  • Assign stable HIR identities to every await expression.
  • Record the completed result type of each async function and the asynchronous type returned by a call.
  • Require await to appear in an async context unless the language contract explicitly defines another context.
  • Require the awaited operand to implement the agreed future/poll contract.
  • Preserve generic substitutions, imported function identity, variant payload types, and source spans.
  • Reject recursive type/effect cycles with diagnostics rather than backend panics.
  • Reject unsupported async FFI and entry-point forms according to the semantics issue.

Completion criteria

  • TypedProgram answers whether a function is async and resolves each await operand/result type.
  • Valid generic and imported async calls retain concrete types after monomorphization.
  • Invalid await contexts and operand types report the relevant source span.
  • No downstream consumer calls AST-local type inference for async nodes.
  • Positive and negative frontend fixtures cover nesting, control flow, variants, pointers, and early returns.

Implementation audit — 2026-09-23

The existing async_frontend tests pass, including concrete generic completion types, await spans, invalid contexts/operands and short-circuit lowering. Remaining acceptance needs a focused import/variant/pointer/early-return coverage audit; checked items are limited to code and tests inspected here.

Activity

  1. added
    enhancement
    needs testing
    refactor
    on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementneeds testingrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions