HigherOrderCO / Bend

A massively parallel, high-level programming language
https://higherorderco.com
Apache License 2.0
17.51k stars 428 forks source link

Type checking allows incorrect match term #734

Closed developedby closed 1 month ago

developedby commented 1 month ago

Reproducing the behavior

The following program type-checks when it shouldn't

type Nat_:
  Zero
  Succ {x: Unit, pred: Nat_}

type Unit:
  Unit

Test1: Nat_ -> (Nat_, Nat_)
Test1 = λx match x {
  Nat_/Zero: (Nat_/Zero, Nat_/Zero)
  Nat_/Succ: (x.x, x.pred)
}

main = *

We expected a "can't unify (Unit, Nat) with (Nat, Nat_)" error.

System Settings

Bend commit 71fb680

Additional context

No response