Skip to content

Implement named proto contracts and generic constraints #348

Open

Description

@LunaStev

Roadmap context

Wave keeps the existing colon-free proto Target { ... } form as an inherent extension. This issue tracks the separate named contract form:

proto Printable : Buffer {
    fun print(self) {
        // target-specific implementation
    }
}

The block defines the named method contract and its implementation for one target at the same time. Wave should not introduce a separate signature-only interface declaration.

Scope

  • Parse and represent proto Name : Target separately from inherent proto blocks.
  • Collect the same proto name across multiple target implementations.
  • Require a matching method surface across those implementations.
  • Support generic constraints such as T: Printable.
  • Resolve constrained method calls statically.
  • Reject duplicate or overlapping implementations and ambiguous method lookup.
  • Preserve module visibility rules.
  • Do not introduce implicit vtables, heap allocation, or runtime interface values.

Completion criteria

  • Multiple targets can implement one named proto contract.
  • Method surface mismatches have source diagnostics.
  • Generic functions and structs enforce proto constraints before code generation.
  • Existing colon-free proto behavior remains unchanged.
  • Valid and invalid cases have frontend and end-to-end regressions.

Parser-only and diagnostic-only pieces may be split into newcomer-sized issues.

Activity

  1. added
    enhancement
    help wanted
    feature request
    on Aug 25, 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

    enhancementfeature requesthelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions