Kind1
Kind1 copied to clipboard
Using P as a field in a datatype
Describe the bug
A clear and concise description of what the bug is. You can paste the code and error to help us see the context.
This datatype does not compile:
type Test{
new(P: Nat),
}
Test: Type
Type mismatch.
- Expected: (:Nat) Type
- Detected: Test
With context:
- Test.Self: Test.Self<P:(:Test) Type> (new:(P:Nat) P(Test.new(P))) P(Test.Self)
- P: (:Test) Type
- : (P:Nat) P(Test.new(P))
- P: Nat
Type mismatch.
- Expected: Nat
- Detected: (:Test) Type
With context:
- P: Nat
- P: (:Test) Type
- new: (P:Nat) P(Test.new(P))
To Reproduce
Steps to reproduce the behavior:
- Write the code on
base/Test.kind
- Use the command
kind Test
Expected behavior
A clear and concise description of what you expected to happen.
It should compile fine, with output:
Test: Type
All terms check.
Environment (please complete the following information):
- OS: Linux
- Kind version: [email protected]
Additional context
Add any other context about the problem here.