cicada-lang / cicada-solo

Cicada Language (solo version)
https://cicada-lang.org
GNU General Public License v3.0
127 stars 5 forks source link

Define Bools in Nat? #11

Open ksqsf opened 2 years ago

ksqsf commented 2 years ago
datatype Bool {
  true: Bool
  false: Bool
}

datatype Nat {
  zero: Bool
  suc(pred: Nat): Bool
}

check! Nat.zero : Bool

Is this expected behavior?

xieyuheng commented 2 years ago

No, this is error that should be reported by the type checker.

The following definition should not be allowed:

datatype Nat {
  zero: Bool
  suc(pred: Nat): Bool
}

Thanks for this feedback!

I will fix this soon.

xieyuheng commented 2 years ago

@xieyuheng test bot replay from tg