cogent icon indicating copy to clipboard operation
cogent copied to clipboard

types in expressions are not normalised

Open zilinc opened this issue 4 years ago • 0 comments

type A = U32

three : A
three = 3

foo : A#[three] -> A
foo x = x@2

It doesn't normalise A to U32 before it converts things into the SMT language, which causes the compiler to crash. It may be due to the equations derived from the constant definitions (https://github.com/au-ts/cogent/blob/master/cogent/src/Cogent/TypeCheck/Solver/SMT.hs#L64), which are taken from the state, in which types are not normalised. Also observed on the wip-reftypes branch.

zilinc avatar Sep 09 '21 07:09 zilinc