Skip to content

Default parameters on a generic type's methods are never filled: impl[T] Bx[T]: fn get(k: i32 = 2) called as b.get() is refused #2002

Closed

Description

@ehartford

Found by the #1973 fix (wave-sema2). impl[T] Bx[T]: fn get(k: i32 = 2) called as b.get() is refused — before the fix with "wrong argument count", now with "expects 1 argument(s), found 0". Default arguments work on non-generic methods and free functions; on a generic type's method the default is never filled (resolve_method_implicit_default_args doesn't reach the generic-method path). Spec: default parameters apply to every callable. Failing-first behavior fixture: a generic type's method with a default, called with and without the argument, plus a generic method on a non-generic type.

Activity

  1. added
    bug
    on Oct 3, 2026
  2. ehartford commented on Oct 3, 2026

    @ehartford
    ContributorAuthor

    Fixed on main in c884c1c (stack #2001 → #2010, seed-driven battery GREEN on b932ef6, tree identical to main). Fixture coverage is in the stack's commits.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions