Login
You're viewing the functional.cafe public feed.
  • Nov 19, 2026, 1:24 AM

    @slava I think you need to use an intermediate associated type, with an equality constraint to tie them together, because of some limitations around cyclic supertrait bounds. I think this does what you want? Not ideal. Thinking about this stuff gives me a headache, though.

    trait N {
    type A: N;
    }

    trait O: N<A = Self::OA> {
    type OA: O;
    }

    💬 1🔄 0⭐ 1

Replies

  • Nov 19, 2026, 1:34 AM

    @slava I think you'd have to manually add the implied equality constraint for B in your second question, even with the new trait solver.

    💬 0🔄 0⭐ 1