Kind1 icon indicating copy to clipboard operation
Kind1 copied to clipboard

Using P as a field in a datatype

Open Eloitor opened this issue 2 years ago • 0 comments

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:

  1. Write the code on base/Test.kind
  2. 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):

Additional context

Add any other context about the problem here.

Eloitor avatar Aug 25 '21 14:08 Eloitor