edwinb / idris2-vim

Vim mode for Idris 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Case splitting inserts invalid code that uses "$resolvedXXX" as an identifer.

stephen-smith opened this issue · comments

There's almost certainly a smaller example, but this is the one I have and it's fairly small.

data BNat = BZ | O BNat | E BNat

data BLT : BNat -> BNat -> Type where
  BLT_ZO : BLT BZ (O bn)
  BLT_ZE : BLT BZ (E bn)
  BLT_OO : BLT bn bm -> BLT (O bn) (O bm)
  BLT_OE : BLT bn bm -> BLT (O bn) (E bm)
  BLT_OE_Eq : BLT (O bn) (E bn)
  BLT_EO : BLT bn bm -> BLT (E bn) (O bm)
  BLT_EE : BLT bn bm -> BLT (E bn) (E bm)

notLtz : BLT bn BZ -> Void
notLtz x = ?notLtz_rhs

Then do a case-split on x in the last line and you get:

notLtz : BLT bn BZ -> Void
notLtz $resolved123 impossible
notLtz $resolved124 impossible
notLtz ($resolved125 x) impossible
notLtz ($resolved127 x) impossible
notLtz $resolved126 impossible
notLtz ($resolved128 x) impossible
notLtz ($resolved129 x) impossible

(the numbers at the end of "resolved" may vary.)