Stream: beginners

Topic: Recursive Dispatch


view this post on Zulip Simon Redding (Sep 03 2026 at 14:11):

Hi,
I'm getting an interesting message from the new compiler:

┌────────────────────┐
│ RECURSIVE DISPATCH ├─ This is_eq dispatch would have to call itself to satisfy its own type. ────────┐
└┬───────────────────┘                                                                                 │
 │                                                                                                     │
 │  expect Op(Gte(TagSeverity(Error))) == parse([Field("severity"), Gte, Ident("error")])?             │
 │                                        ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾             │
 └──────────────────────────────────────────────────────────── /home/simon/working/logq/Cli.roc:170:39 ┘

    The dispatcher type is:

        Query.Expr

    Hint: Use a more specific result type, or add an associated function whose is_eq implementation does
    not require the same dispatch on the same type.

Interestingly, this error goes away and the code works if I replace == with a direct call to .is_eq

Does anyone know what's going on here or has anyone else seen this kind of behaviour?


Last updated: Sep 03 2026 at 15:16 UTC