Skip to content

Resolve nested method-call types through typed HIR #437

Closed

Description

@LunaStev

Summary

AST-local Expression::get_wave_type panics for nested method calls and several other expression kinds. Type information needed after semantic analysis should come from typed HIR rather than being reconstructed from syntax and a local variable map.

Related issues

Relevant code

  • front/parser/src/ast.rs
  • typed HIR expression representation
  • method-call semantic validation
  • LLVM call and address lowering

Scope

Ensure nested method-call chains receive resolved expression types in typed HIR and migrate their downstream consumers away from AST-local type inference. This issue is narrower than migrating the entire backend in #407.

Acceptance criteria

  • Chained and nested method calls type-check when every receiver and return type is valid.
  • Invalid chains report the first failing member with a source span.
  • Backend code consumes the resolved expression type rather than calling the panicking AST helper.
  • Generic receiver and return types remain resolved after monomorphization.
  • No valid nested method call triggers nested method call type inference not supported yet.
  • Positive and negative tests cover fields, pointers/references where supported, generic receivers, and calls used inside larger expressions.

Activity

  1. added
    enhancement
    help wanted
    refactor
    technical debt
    on Aug 29, 2026
  2. LunaStev commented on Sep 23, 2026

    @LunaStev
    MemberAuthor

    Verified the existing typed-HIR method path and reran generic_methods plus generic_methods_and_nested_method_receivers_execute_once. Chained receivers retain resolved pointer types, the invalid-chain fixture points at the first failing member, and the runtime fixture checks generic return values and once-only receiver evaluation. LLVM method consumers use typed expression metadata; this issue is already implemented.

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

    enhancementhelp wantedrefactortechnical debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions