HigherOrderCO / Bend

A massively parallel, high-level programming language

Home Page:https://higherorderco.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't warn on unused generated definitions

developedby opened this issue · comments

When a definition is unused, all of it's generated children will also be unused, which leads to the user-provided function to be printed many times as unused.

For example

def inc(bits):
  match bits:
    case Bits/E:
      return Bits/I (Bits/E)
    case Bits/O:
      return Bits/I (bits.pred)
    case Bits/I:
      return Bits/O (inc(bits.pred))

Will generate the Definition is unused warning 5 times.

Instead, we should check that to send this warning, definitions should not be builtin and should not be generated.

Will be closed by #544 as far as I understand