Idris-dev icon indicating copy to clipboard operation
Idris-dev copied to clipboard

Inconsistency: Unfinished function definition hides negative occurences

Open jasoncarr0 opened this issue 5 years ago • 0 comments

Steps to Reproduce

Define an inductive type mutually with a total function that computes a type with negative usages: bad.idr.txt

%default total

neg : Type -> Type
data Bad : Type -> Type where
  CBad : neg a -> Bad a
neg a = Bad a -> a

extract : Bad Void -> Void
extract c@(CBad f) = f c

inconsistent : Void
inconsistent =
  let b = CBad extract
  in extract b

Expected Behavior

Main.inconsistent is not total

Observed Behavior

*bad> :m
No global holes to solve
*bad> :total inconsistent
Main.inconsistent is Total

Using idris version 1.3.1 from nixpkgs

jasoncarr0 avatar Mar 14 '19 01:03 jasoncarr0