Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define Bools in Nat? #11

Open
ksqsf opened this issue Jan 19, 2022 · 2 comments
Open

Define Bools in Nat? #11

ksqsf opened this issue Jan 19, 2022 · 2 comments

Comments

@ksqsf
Copy link

ksqsf commented Jan 19, 2022

datatype Bool {
  true: Bool
  false: Bool
}

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

check! Nat.zero : Bool

Is this expected behavior?

@xieyuheng
Copy link
Member

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
Copy link
Member

@xieyuheng test bot replay from tg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants